As i mentioned in D43497, automatic destructors are missing in the CFG in situations like
const int &x = C().x;
For now i'd rather disable construction inlining, because inlining constructors while doing nothing on destructors is very bad.
Paths
| Differential D43689
[analyzer] Disable constructor inlining when lifetime extension through fields occurs. ClosedPublic Authored by NoQ on Feb 23 2018, 11:21 AM.
Details
Summary As i mentioned in D43497, automatic destructors are missing in the CFG in situations like const int &x = C().x; For now i'd rather disable construction inlining, because inlining constructors while doing nothing on destructors is very bad.
Diff Detail
Event Timelinedcoughlin added inline comments.
This revision is now accepted and ready to land.Feb 24 2018, 11:08 AM
NoQ added a child revision: D43804: [analyzer] Enable cfg-temporary-dtors by default?.Feb 26 2018, 8:14 PM
Closed by commit rC326240: [analyzer] Disable constructor inlining when lifetime extending through a field. (authored by NoQ). · Explain WhyFeb 27 2018, 12:16 PM This revision was automatically updated to reflect the committed changes. Comment Actions This change caused an assertion failure in ExprEngineCXX.cpp:
Revision Contents
Diff 136133 include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/lifetime-extension.cpp
|
Would you be willing to add a tiny code example to the comment? I.e., const int &x = C().x