summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-12-19 22:10:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-12-19 22:10:51 +0000
commit5a0e50cd87840b9f326e88d3b35c04c3c3b4c76b (patch)
tree6fc3634d210ee2245b5f77302dea00b2402bc870 /clang/test/CXX/expr/expr.prim
parent86a7f7154987ccb1a09fd399162694e120a427a7 (diff)
downloadbcm5719-llvm-5a0e50cd87840b9f326e88d3b35c04c3c3b4c76b.tar.gz
bcm5719-llvm-5a0e50cd87840b9f326e88d3b35c04c3c3b4c76b.zip
DR1048: drop top-level cv-qualifiers when deducing the return type of a
lambda-expression in C++11, to match the C++14 rules. llvm-svn: 224620
Diffstat (limited to 'clang/test/CXX/expr/expr.prim')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
index 1016cb1d305..a36175af6fe 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud