This is an archive of the discontinued LLVM Phabricator instance.

[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.
ClosedPublic

Authored by NoQ on Aug 8 2018, 6:46 PM.

Details

Summary

CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr that represents a construct-expression written as T(Arg1, ..., ArgN), where N is not equal to 1. If N is equal to 1, such expression is parsed as a construction conversion from type of Arg1 to type T instead. Not every temporary object is represented by CXXTemporaryObjectExpr (for instance, implicit temporary copies aren't), and CXXTemporaryObjectExpr doesn't necessarily represent a temporary object (constructor written as a CXXTemporaryObjectExpr may construct a pretty much arbitrary object if copy elision kicks in).

If any of Arg1, ..., ArgN requires construction, give it a construction context of an argument. For now it only works for CXXConstructExprs that aren't CXXTemporaryObjectExprs. I forgot to add it when i was adding stubs for CXXConstructExpr argument constructors in D48249. I thought i had a test for it (passArgumentIntoAnotherConstructor()), but in fact in this test N was equal to 1, so it wasn't really testing a CXXTemporaryObjectExpr.

Diff Detail

Event Timeline

NoQ created this revision.Aug 8 2018, 6:46 PM
This revision is now accepted and ready to land.Aug 10 2018, 10:56 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.