]> granicus.if.org Git - clang/commit
[analyzer] Allow inlining constructors into return values.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 15 Feb 2018 02:32:32 +0000 (02:32 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 15 Feb 2018 02:32:32 +0000 (02:32 +0000)
commit9b6800302fb033718c4e38046cce54c5d7acf23f
tree7de46c51fef652c1b02ddfda29042c61bc0c218e
parenta4bc1e625200c956241403cd6fb320b9eea336ce
[analyzer] Allow inlining constructors into return values.

This only affects the cfg-temporary-dtors mode - in this mode we begin inlining
constructors that are constructing function return values. These constructors
have a correct construction context since r324952.

Because temporary destructors are not only never inlined, but also don't have
the correct target region yet, this change is not entirely safe. But this
will be fixed in the subsequent commits, while this stays off behind the
cfg-temporary-dtors flag.

Lifetime extension for return values is still not modeled correctly.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325202 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/temporaries.cpp