1// RUN: %clang_analyze_cc1 -analyzer-checker=core -fblocks -verify %s
2
3// expected-no-diagnostics
4
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-crash
16  }());
17}
18} // namespace block_rvo_crash
19