brintos

brintos / llvm-project-archived public Read only

0
0
Text · 378 B · fa9435f Raw
19 lines · plain
1// RUN: %clang_analyze_cc1 -analyzer-checker=core -fblocks -verify %s2 3// expected-no-diagnostics4 5namespace block_rvo_crash {6struct A {};7 8A getA();9void use(A a) {}10 11void foo() {12  // This used to crash when finding construction context for getA()13  // (which is use()'s argument due to RVO).14  use(^{15    return getA();  // no-crash16  }());17}18} // namespace block_rvo_crash19