From ba71c085234044f8291b82749552a79d01f99631 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 16 May 2013 06:20:58 +0000 Subject: First pass of semantic analysis for init-captures: check the initializer, build a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985 --- clang/test/Parser/cxx0x-lambda-expressions.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 d7dc7d3a473..76c1e0e7cec 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -54,16 +54,16 @@ class C { void init_capture() { // FIXME: These diagnostics should all disappear once semantic analysis // for init-captures is complete. - [n(0)] () -> int { return ++n; }; // expected-error {{not supported}} expected-error {{undeclared}} - [n{0}] { return; }; // expected-error {{not supported}} - [n = 0] { return ++n; }; // expected-error {{not supported}} expected-error {{undeclared}} - [n = {0}] { return; }; // expected-error {{not supported}} - [a([&b = z]{})](){}; // expected-error 2{{not supported}} + [n(0)] () -> int { return ++n; }; // expected-error {{non-static data member}} + [n{0}] { return; }; // expected-error {{}} + [n = 0] { return ++n; }; // expected-error {{non-static data member}} + [n = {0}] { return; }; // expected-error {{}} + [a([&b = z]{})](){}; - int x = 4; // expected-note {{here}} - auto y = [&r = x, x = x + 1]() -> int { // expected-error 2{{not supported}} expected-note {{here}} - r += 2; // expected-error {{undeclared}} - return x + 2; // expected-error {{implicitly captured}} + 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}} } (); } }; -- cgit v1.2.3