diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-05-06 16:48:12 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-05-06 16:48:12 +0000 |
commit | 2624b8157660902303bfce5551cfdd38272d01e5 (patch) | |
tree | e189d230f3951bfe2b2dbb923459722a19890959 /test/Modules/Inputs/Module.framework/Module | |
parent | b8409215523e5478b8b0aa9cdcd10038cf7651fe (diff) |
Fix representation of compound literals for C++ objects with destructors.
Previously, this compound literal expression (a GNU extension in C++):
(AggregateWithDtor){1, 2}
resulted in this AST:
`-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
`-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
`-CXXBindTemporaryExpr [...] 'struct AggregateWithDtor' (CXXTemporary [...])
`-InitListExpr [...] 'struct AggregateWithDtor'
|-IntegerLiteral [...] 'int' 1
`-IntegerLiteral [...] 'int' 2
Note the two CXXBindTemporaryExprs. The InitListExpr is really part of the
CompoundLiteralExpr, not an object in its own right. By introducing a new
entity initialization kind in Sema specifically for compound literals, we
avoid the treatment of the inner InitListExpr as a temporary.
`-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
`-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
`-InitListExpr [...] 'struct AggregateWithDtor'
|-IntegerLiteral [...] 'int' 1
`-IntegerLiteral [...] 'int' 2
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/Inputs/Module.framework/Module')
0 files changed, 0 insertions, 0 deletions