aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-09 02:12:34 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-09 02:12:34 +0000
commit20f87a4cd91b8d76571dc96aece916ac0bdf8b9f (patch)
treedadaed109f3f25aef109fafdac5948e25a6e23b1 /test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
parent1f9a5db047c00f66f4a1ebfc6ae2bf78433036e3 (diff)
When we create a non-static data member in the closure object for a
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
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp')
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
index 4c876d7480..10d1e927bf 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
@@ -29,3 +29,20 @@ void capture_with_default_args(CopyCtorDefault cct) {
}
// 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!");
+}