summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-08-14 21:10:46 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-08-14 21:10:46 +0000
commitc531d549677609f976b62b90c05829c7c6807369 (patch)
tree3abc0d3214309f5c9e1fb40eb5ca6a8b5e3e9358 /clang/lib/Analysis/CFG.cpp
parentbf33a2cdf2bb01abdf79f5a51792591ad1f6b8e5 (diff)
downloadbcm5719-llvm-c531d549677609f976b62b90c05829c7c6807369.tar.gz
bcm5719-llvm-c531d549677609f976b62b90c05829c7c6807369.zip
[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.
CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr. If it has arguments that are structures passed by value, their respective constructors need to be handled by providing a ConstructionContext, like for regular function calls and for regular constructors. Differential Revision: https://reviews.llvm.org/D50487 llvm-svn: 339727
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 97829de7ace..ae7917d6772 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -4352,6 +4352,11 @@ CFGBlock *CFGBuilder::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E,
CFGBlock *CFGBuilder::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *C,
AddStmtChoice asc) {
+ // If the constructor takes objects as arguments by value, we need to properly
+ // construct these objects. Construction contexts we find here aren't for the
+ // constructor C, they're for its arguments only.
+ findConstructionContextsForArguments(C);
+
autoCreateBlock();
appendConstructor(Block, C);
return VisitChildren(C);
OpenPOWER on IntegriCloud