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 | 7 |
1 files changed, 2 insertions, 5 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 1016cb1..a36175a 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp @@ -34,15 +34,12 @@ X infer_X_return_type(X x) { }(5); } -X infer_X_return_type_fail(X x) { +X infer_X_return_type_2(X x) { return [x](int y) { if (y > 0) return X(); else - 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 + return x; // ok even in c++11, per dr1048. }(5); } |