summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-11 02:51:16 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-11 02:51:16 +0000
commitc9751069f5c99635fef60030041b904c0a431707 (patch)
treee5412bb2e293dcfda900c9aeba08b5c25e4492a3 /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
parentd0e58e9be8115c88c80f79a1fde229d735927641 (diff)
downloadbcm5719-llvm-c9751069f5c99635fef60030041b904c0a431707.tar.gz
bcm5719-llvm-c9751069f5c99635fef60030041b904c0a431707.zip
Make sure Sema creates a field for 'this' captures. (Doug, please double-check that this is correct.)
llvm-svn: 150292
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
index ad603e17193..1f7580eedc1 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
@@ -55,3 +55,11 @@ void test_layout(char a, short b) {
};
static_assert(sizeof(x) == sizeof(ExpectedLayout), "Layout mismatch!");
}
+
+struct ExpectedThisLayout {
+ ExpectedThisLayout* a;
+ void f() {
+ auto x = [this]() -> void {};
+ static_assert(sizeof(x) == sizeof(ExpectedThisLayout), "Layout mismatch!");
+ }
+};
OpenPOWER on IntegriCloud