]> granicus.if.org Git - clang/commit
[analyzer] Handle CXXTemporaryObjectExprs in compound literals.
authorJordan Rose <jordan_rose@apple.com>
Mon, 6 May 2013 16:48:20 +0000 (16:48 +0000)
committerJordan Rose <jordan_rose@apple.com>
Mon, 6 May 2013 16:48:20 +0000 (16:48 +0000)
commit6376703eb3325fe41233aed234fde81164af42a1
tree0f214678f63f7f3eb4dcfd44bc68d024a7def91f
parent2624b8157660902303bfce5551cfdd38272d01e5
[analyzer] Handle CXXTemporaryObjectExprs in compound literals.

This occurs because in C++11 the compound literal syntax can trigger a
constructor call via list-initialization. That is, "Point{x, y}" and
"(Point){x, y}" end up being equivalent. If this occurs, the inner
CXXConstructExpr will have already handled the object construction; the
CompoundLiteralExpr just needs to propagate that value forwards.

<rdar://problem/13804098>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181213 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineC.cpp
test/Analysis/temporaries.cpp