Defer creating fields for captures until we finish building the
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 28 May 2019 23:09:46 +0000 (23:09 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 28 May 2019 23:09:46 +0000 (23:09 +0000)
commit30116531b8a9acc0b25648f9e27c11265d149d60
tree7defe572be6841f9f37770eb973703c3a5c21409
parente925be1339052b2f363d1b708370a45868fada04
Defer creating fields for captures until we finish building the
capturing expression or statement.

No functionality change yet. The intent is that we will also delay
building the initialization expression until the enclosing context, so
that:
a) we build the initialization expression in the right context, and
b) we can elide captures that are not odr-used, as suggested by P0588R1.

This also consolidates some duplicated code building capture fields into
a single place.

llvm-svn: 361893
clang/include/clang/Sema/ScopeInfo.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/ScopeInfo.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaLambda.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/TreeTransform.h
clang/test/AST/ast-dump-expr.cpp