aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-09 00:47:04 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-09 00:47:04 +0000
commit503384f731b5abcbf870b0a5224eb920e631db0a (patch)
tree0af31e2390158648077180f89fe1f0e19f4eed6f /test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
parent91c2a1192cdd4e7b2b4ac7838c5aceef200ea251 (diff)
Various interrelated cleanups for lambdas:
- Complete the lambda class when we finish the lambda expression (previously, it was left in the "being completed" state) - Actually return the LambdaExpr object and bind to the resulting temporary when needed. - Detect when cleanups are needed while capturing a variable into a lambda (e.g., due to default arguments in the copy constructor), and make sure those cleanups apply for the whole of the lambda expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp')
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
index 4bd5760bc4..53d2c75772 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
@@ -4,13 +4,13 @@ class X0 {
void explicit_capture() {
int foo;
- [foo, foo] () {}; // expected-error {{'foo' can appear only once}} expected-error {{not supported yet}}
- [this, this] () {}; // expected-error {{'this' can appear only once}} expected-error {{not supported yet}}
- [=, foo] () {}; // expected-error {{'&' must precede a capture when}} expected-error {{not supported yet}}
- [=, &foo] () {}; // expected-error {{not supported yet}}
- [=, this] () {}; // expected-error {{'this' cannot appear}} expected-error {{not supported yet}}
- [&, foo] () {}; // expected-error {{not supported yet}}
- [&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}} expected-error {{not supported yet}}
- [&, this] () {}; // expected-error {{not supported yet}}
+ (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}} expected-error {{not supported yet}}
+ (void)[this, this] () {}; // expected-error {{'this' can appear only once}} expected-error {{not supported yet}}
+ (void)[=, foo] () {}; // expected-error {{'&' must precede a capture when}} expected-error {{not supported yet}}
+ (void)[=, &foo] () {}; // expected-error {{not supported yet}}
+ (void)[=, this] () {}; // expected-error {{'this' cannot appear}} expected-error {{not supported yet}}
+ (void)[&, foo] () {}; // expected-error {{not supported yet}}
+ (void)[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}} expected-error {{not supported yet}}
+ (void)[&, this] () {}; // expected-error {{not supported yet}}
}
};