diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-04-12 20:03:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-04-12 20:03:47 +0000 |
commit | 49a7ef5c2331e77d6a2b9e53b469ab93dd075fff (patch) | |
tree | dbba30b1603233b182c40aa6254542c0f94815fc | |
parent | e2499844a23b8be64c1ff86386f512cad9c62d36 (diff) | |
download | bcm5719-llvm-49a7ef5c2331e77d6a2b9e53b469ab93dd075fff.tar.gz bcm5719-llvm-49a7ef5c2331e77d6a2b9e53b469ab93dd075fff.zip |
Add -Wuninitialized test for C++11 lambdas.
llvm-svn: 154608
-rw-r--r-- | clang/test/SemaCXX/uninitialized.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp index 15c06eb421e..7879e7c7531 100644 --- a/clang/test/SemaCXX/uninitialized.cpp +++ b/clang/test/SemaCXX/uninitialized.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -Wall -Wuninitialized -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wall -Wuninitialized -std=c++11 -verify %s int foo(int x); int bar(int* x); @@ -162,3 +162,8 @@ int pr12325(int params) { return x; } +// Test lambda expressions with -Wuninitialized +int test_lambda() { + auto f1 = [] (int x, int y) { int z; return x + y + z; }; // expected-warning {{C++11 requires lambda with omitted result type to consist of a single return statement}} expected-warning{{variable 'z' is uninitialized when used here}} expected-note {{initialize the variable 'z' to silence this warning}} + return f1(1, 2); +} |