From: Jordan Rose Date: Tue, 1 Apr 2014 16:39:59 +0000 (+0000) Subject: [analyzer] Remove incorrect workaround for unimplemented temporary destructors. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06445783fadc367e5cf22d79d3708460183c7904;p=clang [analyzer] Remove incorrect workaround for unimplemented temporary destructors. If we're trying to get the zero element region of something that's not a region, we should be returning UnknownVal, which is what ProgramState::getLValue will do for us. Patch by Alex McCarthy! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205327 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index fbbc73cc73..5dd16944e7 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -91,12 +91,6 @@ void ExprEngine::performTrivialCopy(NodeBuilder &Bldr, ExplodedNode *Pred, /// If the type is not an array type at all, the original value is returned. static SVal makeZeroElementRegion(ProgramStateRef State, SVal LValue, QualType &Ty) { - // FIXME: This check is just a temporary workaround, because - // ProcessTemporaryDtor sends us NULL regions. It will not be necessary once - // we can properly process temporary destructors. - if (!LValue.getAsRegion()) - return LValue; - SValBuilder &SVB = State->getStateManager().getSValBuilder(); ASTContext &Ctx = SVB.getContext(); diff --git a/test/Analysis/dtor-cxx11.cpp b/test/Analysis/dtor-cxx11.cpp index 5c9024b8ed..7d2e87e44e 100644 --- a/test/Analysis/dtor-cxx11.cpp +++ b/test/Analysis/dtor-cxx11.cpp @@ -8,8 +8,8 @@ namespace Cxx11BraceInit { ~Foo() {} }; - /* FIXME: Don't crash here. void testInitializerList() { for (Foo foo : {Foo(), Foo()}) {} - } */ + } } +