[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)
commit19ed6748ea2ff303040702cc6043b9a0c6ca9ce1
tree22df0f48953de08756ce746d0177bcaf276f7355
parentb559f185842eef73066382adcdfda9255608ad6f
[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>.

llvm-svn: 164830
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/test/Analysis/array-struct-region.cpp
clang/test/Analysis/ctor-inlining.mm