summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-06-14 01:54:21 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-06-14 01:54:21 +0000
commit53b8ce0edbad190746ef2a94acd851ac77eef702 (patch)
tree399637ea2df0b501a7a39f06ae3ce98c3cbc695e /clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
parenta84374dc0e4e756a92191dd55efca43165e3977d (diff)
downloadbcm5719-llvm-53b8ce0edbad190746ef2a94acd851ac77eef702.tar.gz
bcm5719-llvm-53b8ce0edbad190746ef2a94acd851ac77eef702.zip
[analyzer] Re-enable C++17-specific variable and member construction contexts.
Not contexts themselves, but rather support for them in the analyzer. Such construction contexts appear when C++17 mandatory copy elision occurs during initialization, and presence of a destructor causes a CXXBindTemporaryExpr to appear in the AST. Similar C++17-specific constructors for return values are still to be supported. Differential Revision: https://reviews.llvm.org/D47351 llvm-svn: 334683
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
index ada99e1369d..1dd094b90f8 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
@@ -119,8 +119,9 @@ std::pair<ProgramStateRef, SVal> ExprEngine::prepareForObjectConstruction(
// current construction context.
if (CC) {
switch (CC->getKind()) {
+ case ConstructionContext::CXX17ElidedCopyVariableKind:
case ConstructionContext::SimpleVariableKind: {
- const auto *DSCC = cast<SimpleVariableConstructionContext>(CC);
+ const auto *DSCC = cast<VariableConstructionContext>(CC);
const auto *DS = DSCC->getDeclStmt();
const auto *Var = cast<VarDecl>(DS->getSingleDecl());
SVal LValue = State->getLValue(Var, LCtx);
@@ -131,6 +132,7 @@ std::pair<ProgramStateRef, SVal> ExprEngine::prepareForObjectConstruction(
addObjectUnderConstruction(State, DSCC->getDeclStmt(), LCtx, LValue);
return std::make_pair(State, LValue);
}
+ case ConstructionContext::CXX17ElidedCopyConstructorInitializerKind:
case ConstructionContext::SimpleConstructorInitializerKind: {
const auto *ICC = cast<ConstructorInitializerConstructionContext>(CC);
const auto *Init = ICC->getCXXCtorInitializer();
@@ -259,9 +261,7 @@ std::pair<ProgramStateRef, SVal> ExprEngine::prepareForObjectConstruction(
CallOpts.IsTemporaryCtorOrDtor = true;
return std::make_pair(State, V);
}
- case ConstructionContext::CXX17ElidedCopyVariableKind:
case ConstructionContext::CXX17ElidedCopyReturnedValueKind:
- case ConstructionContext::CXX17ElidedCopyConstructorInitializerKind:
// Not implemented yet.
break;
}
OpenPOWER on IntegriCloud