From bb13c9a49d08b56b9a8f04bd76ad3a7972bcc478 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 28 Sep 2013 04:02:39 +0000 Subject: 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 --- clang/test/Parser/cxx0x-lambda-expressions.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp') diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index 76c1e0e7cec..426e530251f 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 {{}} - [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 {{}} [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; } (); } }; -- cgit v1.2.3