summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp3
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
index 58fa7663526..1723ee39fd7 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
@@ -13,4 +13,7 @@ void test_capture(X x) {
[x] { // expected-error{{call to deleted constructor of 'const X'}}
}();
}();
+
+ int a;
+ [=]{ [&] { int&x = a; }(); }(); // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}}
}
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp
index 03cbe32ef4e..e9356136c7b 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp
@@ -17,12 +17,12 @@ void f3() {
const int &irc = i;
[=,&irc,&ir] {
+ static_assert(is_same<decltype(((r))), float const&>::value,
+ "should be const float&");
static_assert(is_same<decltype(x), float>::value, "should be float");
static_assert(is_same<decltype((x)), const float&>::value,
"should be const float&");
static_assert(is_same<decltype(r), float&>::value, "should be float&");
- static_assert(is_same<decltype(((r))), float const&>::value,
- "should be const float&");
static_assert(is_same<decltype(ir), int&>::value, "should be int&");
static_assert(is_same<decltype((ir)), int&>::value, "should be int&");
static_assert(is_same<decltype(irc), const int&>::value,
OpenPOWER on IntegriCloud