summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-18 05:51:20 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-18 05:51:20 +0000
commit812d8f638761284a830219e5471bac504942ee83 (patch)
tree904484c2df20175edec7d1c23cfbbf5afaf84a17 /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
parentd9e416c0ea61c13440e99fdab86e44c6e71a8eff (diff)
downloadbcm5719-llvm-812d8f638761284a830219e5471bac504942ee83.tar.gz
bcm5719-llvm-812d8f638761284a830219e5471bac504942ee83.zip
Unify our computation of the type of a captured reference to a
variable; it was previously duplicated, and one of the copies failed to account for outer non-mutable lambda captures. llvm-svn: 150872
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp3
1 files changed, 3 insertions, 0 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}}
}
OpenPOWER on IntegriCloud