[analyzer] Fix invalidation when returning into a ctor initializer.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 1 Jul 2019 23:02:18 +0000 (23:02 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 1 Jul 2019 23:02:18 +0000 (23:02 +0000)
commitceb639dbeea97c901b2642ebe296eb358d27b2f6
treea8a86d4fe063869ad50940409ed31bb73f952923
parent512f4838c47c5bab13d8bb0eabc01d64222825ae
[analyzer] Fix invalidation when returning into a ctor initializer.

Due to RVO the target region of a function that returns an object by
value isn't necessarily a temporary object region; it may be an
arbitrary memory region. In particular, it may be a field of a bigger
object.

Make sure we don't invalidate the bigger object when said function is
evaluated conservatively.

Differential Revision: https://reviews.llvm.org/D63968

llvm-svn: 364870
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/test/Analysis/rvo.cpp [new file with mode: 0644]