diff options
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp index f580e7e..1016cb1 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify +// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify -DCPP1Y void missing_lambda_declarator() { [](){}(); @@ -17,7 +18,7 @@ void infer_void_return_type(int i) { switch (x) { case 0: return get<void>(); case 1: return; - case 2: return { 1, 2.0 }; // expected-error{{cannot deduce lambda return type from initializer list}} + case 2: return { 1, 2.0 }; //expected-error{{cannot deduce}} } }(7); } @@ -38,7 +39,10 @@ X infer_X_return_type_fail(X x) { if (y > 0) return X(); else - return x; // expected-error{{return type 'const X' must match previous return type 'X' when lambda expression has unspecified explicit return type}} + return x; +#if __cplusplus <= 201103L + // expected-error@-2 {{return type 'const X' must match previous return type 'X' when lambda expression has unspecified explicit return type}} +#endif }(5); } |