This is an archive of the discontinued LLVM Phabricator instance.

[CFG] [analyzer] Add construction context when the constructor is on a branch of a ternary operator
ClosedPublic

Authored by NoQ on Feb 19 2018, 2:46 PM.

Details

Summary

Similarly to D43480 and D43481, we need to skip the ternary conditional operator ... ? ... : ... when it stands between the MaterializeTemporaryExpr and the CXXBindTemporaryExpr.

This allows us to find the common materialization target (MaterializeTemporaryExpr) for the two branches of the conditional operator, which would later be used for improving lifetime extension support in the analyzer, but for now the change has no immediate effect on the analyzer.

GNU binary conditional operator is not supported yet.

Diff Detail

Event Timeline

NoQ created this revision.Feb 19 2018, 2:46 PM
NoQ updated this revision to Diff 134979.Feb 19 2018, 2:54 PM

Fix the test.

dcoughlin accepted this revision.Feb 20 2018, 9:01 PM

This seems reasonable to me.

This revision is now accepted and ready to land.Feb 20 2018, 9:01 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.