]> granicus.if.org Git - clang/commitdiff
Sink variable into assert
authorMatt Beaumont-Gay <matthewbg@google.com>
Fri, 24 Feb 2012 08:37:56 +0000 (08:37 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Fri, 24 Feb 2012 08:37:56 +0000 (08:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151356 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp

index 756f130b7fdcca0a00bfd2b8ba76e8de4daae8fb..fcc74e7d3fb0cb5aba88848e167db38709aa587b 100644 (file)
@@ -4628,8 +4628,7 @@ PerformConstructorInitialization(Sema &S,
     // Force even a trivial, implicit default constructor to be
     // semantically checked. We do this explicitly because we don't build
     // the definition for completely trivial constructors.
-    CXXRecordDecl *ClassDecl = Constructor->getParent();
-    assert(ClassDecl && "No parent class for constructor.");
+    assert(Constructor->getParent() && "No parent class for constructor.");
     if (Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
         Constructor->isTrivial() && !Constructor->isUsed(false))
       S.DefineImplicitDefaultConstructor(Loc, Constructor);