summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-02-24 02:05:11 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-02-24 02:05:11 +0000
commitceb7d91a484982cfca84c102cfddb90b3963c46e (patch)
treecc1383f10e70f864e3f97dc2ecc1cde4ae5c4698 /clang/lib/Analysis
parentf43ac4c9acb023ac9fd44e2836d852dc5ce9d0e2 (diff)
downloadbcm5719-llvm-ceb7d91a484982cfca84c102cfddb90b3963c46e.tar.gz
bcm5719-llvm-ceb7d91a484982cfca84c102cfddb90b3963c46e.zip
[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
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 13804746b27..0d100397c0c 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -1177,6 +1177,8 @@ void CFGBuilder::findConstructionContexts(
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,
OpenPOWER on IntegriCloud