summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprMember.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-05-06 16:48:12 +0000
committerJordan Rose <jordan_rose@apple.com>2013-05-06 16:48:12 +0000
commit6c0505e4eb7ac4be17f6a6548ae843b2bb7bf01d (patch)
treeb48c83dece36aa662c3045bdd51a5f9bb1ec3cec /clang/lib/Sema/SemaExprMember.cpp
parent47445073f8cf1bb25bae288e701ca20f11544e0f (diff)
downloadbcm5719-llvm-6c0505e4eb7ac4be17f6a6548ae843b2bb7bf01d.tar.gz
bcm5719-llvm-6c0505e4eb7ac4be17f6a6548ae843b2bb7bf01d.zip
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 llvm-svn: 181212
Diffstat (limited to 'clang/lib/Sema/SemaExprMember.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud