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
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
index d1384f1..408fb75 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
@@ -26,4 +26,7 @@
(void)[=, this]{ }; // expected-error{{'this' cannot be explicitly captured}}
(void)[=]{ this->g(i); };
(void)[i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i(0), i(1)]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i, i(1)]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i(0), i]{ }; // expected-error{{'i' can appear only once in a capture list}}
}