[CFG] Provide construction contexts for functional cast-like constructors.
When a constructor of a temporary with a single argument is treated
as a functional cast expression, skip the functional cast expression
and provide the correct construction context for the temporary.
Differential Revision: https://reviews.llvm.org/D43480
llvm-svn: 326015
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 1380474..0d10039 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -1177,6 +1177,8 @@
consumeConstructionContext(ContextSoFar, CE);
} else if (auto *Cleanups = dyn_cast<ExprWithCleanups>(Child)) {
findConstructionContexts(ContextSoFar, Cleanups->getSubExpr());
+ } else if (auto *Cast = dyn_cast<CXXFunctionalCastExpr>(Child)) {
+ findConstructionContexts(ContextSoFar, Cast->getSubExpr());
} else if (auto *BTE = dyn_cast<CXXBindTemporaryExpr>(Child)) {
findConstructionContexts(
ConstructionContext::create(cfg->getBumpVectorContext(), BTE,