mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 05:16:42 +00:00

When looking for the location context of the call site, unwrap block invocation contexts because they are attached to the current AnalysisDeclContext while what we need is the previous AnalysisDeclContext. Differential Revision: https://reviews.llvm.org/D61545 llvm-svn: 360202
19 lines
378 B
Plaintext
19 lines
378 B
Plaintext
// RUN: %clang_analyze_cc1 -analyzer-checker=core -fblocks -verify %s
|
|
|
|
// expected-no-diagnostics
|
|
|
|
namespace block_rvo_crash {
|
|
struct A {};
|
|
|
|
A getA();
|
|
void use(A a) {}
|
|
|
|
void foo() {
|
|
// This used to crash when finding construction context for getA()
|
|
// (which is use()'s argument due to RVO).
|
|
use(^{
|
|
return getA(); // no-crash
|
|
}());
|
|
}
|
|
} // namespace block_rvo_crash
|