summaryrefslogtreecommitdiff
path: root/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
commit668165ab1e604b063c0aa0df8ff91c80879670bf (patch)
tree5528d576fe6e69f4af6bacaa1d1bf408e406b8f0 /test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
parentb70a3bad9c767b3cdeadf363d4dbe8ad25a26588 (diff)
downloadclang-668165ab1e604b063c0aa0df8ff91c80879670bf.tar.gz
clang-668165ab1e604b063c0aa0df8ff91c80879670bf.tar.bz2
clang-668165ab1e604b063c0aa0df8ff91c80879670bf.tar.xz
Make sure Sema creates a field for 'this' captures. (Doug, please double-check that this is correct.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150292 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.cpp8
1 files changed, 8 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 ad603e1719..1f7580eedc 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
+++ b/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!");
+ }
+};