diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-28 04:02:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-28 04:02:39 +0000 |
commit | bb13c9a49d08b56b9a8f04bd76ad3a7972bcc478 (patch) | |
tree | 65d9331fbe86ec254e57c2043d96dde642427196 /clang/test/Parser/cxx0x-lambda-expressions.cpp | |
parent | 45015d9796c116c97510919179efdef9f18a99db (diff) | |
download | llvm-bb13c9a49d08b56b9a8f04bd76ad3a7972bcc478.zip llvm-bb13c9a49d08b56b9a8f04bd76ad3a7972bcc478.tar.gz llvm-bb13c9a49d08b56b9a8f04bd76ad3a7972bcc478.tar.bz2 |
Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.
llvm-svn: 191605
Diffstat (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-lambda-expressions.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index 76c1e0e..426e530 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -52,18 +52,16 @@ class C { // We support init-captures in C++11 as an extension. int z; void init_capture() { - // FIXME: These diagnostics should all disappear once semantic analysis - // for init-captures is complete. - [n(0)] () -> int { return ++n; }; // expected-error {{non-static data member}} + [n(0)] () mutable -> int { return ++n; }; [n{0}] { return; }; // expected-error {{<initializer_list>}} - [n = 0] { return ++n; }; // expected-error {{non-static data member}} + [n = 0] { return ++n; }; // expected-error {{captured by copy in a non-mutable}} [n = {0}] { return; }; // expected-error {{<initializer_list>}} [a([&b = z]{})](){}; int x = 4; auto y = [&r = x, x = x + 1]() -> int { - r += 2; // expected-error {{non-static data member}} - return x + 2; // expected-error {{non-static data member}} + r += 2; + return x + 2; } (); } }; |