capture, make sure we actually add the field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150135
91177308-0d34-0410-b5e6-
96231b3b80d8
0, false, false);
Field->setImplicit(true);
Field->setAccess(AS_private);
+ Lambda->addDecl(Field);
// C++11 [expr.prim.lambda]p21:
// When the lambda-expression is evaluated, the entities that
}
// FIXME: arrays!
+
+// Check for the expected non-static data members.
+
+struct ExpectedLayout {
+ char a;
+ short b;
+};
+
+template<typename T> void capture(const T&);
+
+void test_layout(char a, short b) {
+ auto x = [=] () -> void { // expected-error{{lambda expressions are not supported yet}}
+ capture(a);
+ capture(b);
+ };
+ static_assert(sizeof(x) == sizeof(ExpectedLayout), "Layout mismatch!");
+}