[analyzer] Disable constructor inlining when lifetime extending through a field.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 27 Feb 2018 20:14:06 +0000 (20:14 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 27 Feb 2018 20:14:06 +0000 (20:14 +0000)
commit8cd7961a0af7914345ba9ab8583e7fe7b7367b47
treec72a8a41b37b752231aa5d633cf2fcd492f090ca
parentb7f53df0c2b5f33e562de876f51a18eace0b4997
[analyzer] Disable constructor inlining when lifetime extending through a field.

Automatic destructors are missing in the CFG in situations like

  const int &x = C().x;

For now it's better to disable construction inlining, because inlining
constructors while doing nothing on destructors is very bad.

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

llvm-svn: 326240
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/test/Analysis/lifetime-extension.cpp