]> granicus.if.org Git - clang/commit
[analyzer] Re-enable constructors when lifetime extension through fields occurs.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 4 Jun 2018 20:18:37 +0000 (20:18 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 4 Jun 2018 20:18:37 +0000 (20:18 +0000)
commit01f66df781bfe1c328d807dcc2a93b44f644afe6
tree03907a9d095e4e35553e4f0fe19a27f63ed9824e
parentedfb78dee78bc88f0e0aa12f1967b24f5d8f45ee
[analyzer] Re-enable constructors when lifetime extension through fields occurs.

Temporary object constructor inlining was disabled in r326240 for code like

    const int &x = A().x;

because automatic destructor for the lifetime-extended object A() was not
working correctly in CFG.

CFG was fixed in r333941, so inlining can be re-enabled. CFG for lifetime
extension through aggregates still needs to be fixed.

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

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