]> granicus.if.org Git - clang/commit
[analyzer] Handle inlined constructors for rvalue temporaries correctly.
authorJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 17:15:25 +0000 (17:15 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 17:15:25 +0000 (17:15 +0000)
commit580cd17f256259f39a382e967173f34d68e73859
treea0df4672761efa01920c6b045dae9615ae1c1cbf
parent0006ba445962621ed82ec84400a6b978205a3fbc
[analyzer] Handle inlined constructors for rvalue temporaries correctly.

Previously the analyzer treated all inlined constructors like lvalues,
setting the value of the CXXConstructExpr to the newly-constructed
region. However, some CXXConstructExprs behave like rvalues -- in
particular, the implicit copy constructor into a pass-by-value argument.
In this case, we want only the /contents/ of a temporary object to be
passed, so that we can use the same "copy each argument into the
parameter region" algorithm that we use for scalar arguments.

This may change when we start modeling destructors of temporaries,
but for now this is the last part of <rdar://problem/12137950>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164830 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/array-struct-region.cpp
test/Analysis/ctor-inlining.mm