diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-03 19:16:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-03 19:16:22 +0000 |
commit | fa11fd669f45fe5a439d83c70de63f663ef57eb9 (patch) | |
tree | 783c04b2c57b0efcaa490fe90e85a8d884efd866 /clang/test/SemaCXX/uninitialized.cpp | |
parent | 4ffff2791f9d92069d02b3f33274885cf433cebd (diff) | |
download | bcm5719-llvm-fa11fd669f45fe5a439d83c70de63f663ef57eb9.tar.gz bcm5719-llvm-fa11fd669f45fe5a439d83c70de63f663ef57eb9.zip |
PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.
llvm-svn: 181046
Diffstat (limited to 'clang/test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | clang/test/SemaCXX/uninitialized.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp index 2aa56623f69..665cfe7e911 100644 --- a/clang/test/SemaCXX/uninitialized.cpp +++ b/clang/test/SemaCXX/uninitialized.cpp @@ -511,3 +511,15 @@ namespace operators { int x = x = 5; } + +namespace lambdas { + struct A { + template<typename T> A(T) {} + int x; + }; + A a0([] { return a0.x; }); // ok + void f() { + A a1([=] { return a1.x; }); // expected-warning{{variable 'a1' is uninitialized when used within its own initialization}} + A a2([&] { return a2.x; }); // ok + } +} |