summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/lambda-expressions.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-01 17:04:21 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-01 17:04:21 +0000
commitcdd11d4e7ef70e878ddacf0fc8e324ed344f3ce8 (patch)
tree783075d594a1ae37b5f7727e30b1c50febc1ea30 /clang/test/SemaCXX/lambda-expressions.cpp
parent62efe0b062268170c2caf659863396e4c110192f (diff)
downloadbcm5719-llvm-cdd11d4e7ef70e878ddacf0fc8e324ed344f3ce8.tar.gz
bcm5719-llvm-cdd11d4e7ef70e878ddacf0fc8e324ed344f3ce8.zip
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. llvm-svn: 149516
Diffstat (limited to 'clang/test/SemaCXX/lambda-expressions.cpp')
-rw-r--r--clang/test/SemaCXX/lambda-expressions.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp
index cacd4b680ce..a2dc7070dc4 100644
--- a/clang/test/SemaCXX/lambda-expressions.cpp
+++ b/clang/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}}
}
}
OpenPOWER on IntegriCloud