diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-01 17:04:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-01 17:04:21 +0000 |
commit | a1f2114d9e81923c750f6b439302ac03552c37db (patch) | |
tree | f1d7870705191f7fbb5e25b4c33f7a55b06994d4 /test/SemaCXX/lambda-expressions.cpp | |
parent | ac4e5b7a111ec3a91bf360b2213b10975f87ca17 (diff) |
Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
- We get rid of the ugly dance of computing all of the captures in
data structures that clone those of CapturingScopeInfo, centralizing
the logic for accessing/updating these data structures
- We re-use the existing capture logic for 'this', which actually
works now.
Cleaned up some diagnostic wording in minor ways as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/lambda-expressions.cpp')
-rw-r--r-- | test/SemaCXX/lambda-expressions.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp index cacd4b680c..a2dc7070dc 100644 --- a/test/SemaCXX/lambda-expressions.cpp +++ b/test/SemaCXX/lambda-expressions.cpp @@ -13,9 +13,9 @@ namespace ExplicitCapture { void ImplicitThisCapture() { [](){(void)Member;}; // expected-error {{'this' cannot be implicitly captured in this context}} expected-error {{not supported yet}} [&](){(void)Member;}; // expected-error {{not supported yet}} - // FIXME: 'this' captures below don't actually work yet - // FIXME: [this](){(void)Member;}; - // FIXME: [this]{[this]{};}; + // 'this' captures below don't actually work yet + [this](){(void)Member;}; // expected-error{{lambda expressions are not supported yet}} + [this]{[this]{};}; // expected-error 2{{lambda expressions are not supported yet}} []{[this]{};};// expected-error {{'this' cannot be implicitly captured in this context}} expected-error 2 {{not supported yet}} []{Overload(3);}; // expected-error {{not supported yet}} []{Overload();}; // expected-error {{'this' cannot be implicitly captured in this context}} expected-error {{not supported yet}} @@ -25,7 +25,7 @@ namespace ExplicitCapture { }; void f() { - [this] () {}; // expected-error {{invalid use of 'this'}} expected-error {{not supported yet}} + [this] () {}; // expected-error {{'this' cannot be captured in this context}} expected-error {{not supported yet}} } } |