diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-09 00:47:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-09 00:47:04 +0000 |
commit | 8c50e7c5e380d93f784582579c3e3f1bc157bf12 (patch) | |
tree | d6556ee13f1264af6738a39fd7c043365bfeb166 /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp | |
parent | f542675ae34943a85ffcdb9d07c69b181c3d869f (diff) | |
download | bcm5719-llvm-8c50e7c5e380d93f784582579c3e3f1bc157bf12.tar.gz bcm5719-llvm-8c50e7c5e380d93f784582579c3e3f1bc157bf12.zip |
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.
llvm-svn: 150123
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp index 497307ff755..6f09c53e576 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -std=c++11 %s -verify -int GlobalVar; // expected-note 2{{declared here}} +int GlobalVar; // expected-note {{declared here}} namespace N { int AmbiguousVar; // expected-note {{candidate}} @@ -16,9 +16,11 @@ class X0 { virtual X0& Overload(float); void explicit_capture() { - [&Overload] () {}; // expected-error {{does not name a variable}} expected-error {{not supported yet}} - [&GlobalVar] () {}; // expected-error {{does not have automatic storage duration}} expected-error {{not supported yet}} - [&AmbiguousVar] () {} // expected-error {{reference to 'AmbiguousVar' is ambiguous}} expected-error {{not supported yet}} - [&Globalvar] () {}; // expected-error {{use of undeclared identifier 'Globalvar'; did you mean 'GlobalVar}} + int variable; // expected-note {{declared here}} + (void)[&Overload] () {}; // expected-error {{does not name a variable}} expected-error {{not supported yet}} + (void)[&GlobalVar] () {}; // expected-error {{does not have automatic storage duration}} expected-error {{not supported yet}} + (void)[&AmbiguousVar] () {}; // expected-error {{reference to 'AmbiguousVar' is ambiguous}} expected-error {{not supported yet}} + (void)[&Variable] () {}; // expected-error {{use of undeclared identifier 'Variable'; did you mean 'variable'}} \ + // expected-error{{lambda expressions are not supported yet}} } }; |