]> granicus.if.org Git - clang/commit
Require the type of a by-copy capture to be complete before creating its field.
authorDouglas Gregor <dgregor@apple.com>
Wed, 18 Dec 2013 23:02:36 +0000 (23:02 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 18 Dec 2013 23:02:36 +0000 (23:02 +0000)
commitee698e84c17bf0fb97f5d8c8f4061125c749715e
tree785bd90264461d003985bc83fccb08494a0adc14
parent01505716d11c22384d610b32f4599c62272088bc
Require the type of a by-copy capture to be complete before creating its field.

The problem here is more serious than the fix implies. Adding a field
to a class updates the triviality bits for the class (among other
things). Failing to require a complete type before adding the field
meant that these updates don't happen in the well-formed case where
the capture is an uninstantiated class template specialization,
leading the lambda itself to be treated as having a trivial copy
constructor when it shouldn't. Fixes <rdar://problem/15560464>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197623 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp