Index: llvm/TwineLocalCheck.cpp =================================================================== --- llvm/TwineLocalCheck.cpp +++ llvm/TwineLocalCheck.cpp @@ -35,8 +35,12 @@ // of the initializer. const Expr *C = VD->getInit()->IgnoreImplicit(); - while (isa(C)) + while (isa(C)){ + if (cast(C)->getNumArgs() == 0) { + break; + } C = cast(C)->getArg(0)->IgnoreParenImpCasts(); + } SourceRange TypeRange = VD->getTypeSourceInfo()->getTypeLoc().getSourceRange();