From: Douglas Gregor Date: Tue, 1 Mar 2011 00:34:57 +0000 (+0000) Subject: Fix some regressions in the GCC testsuite due to bad souce-location X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=640519e971af2bfe82d093d555146bdeecc8cc39;p=clang Fix some regressions in the GCC testsuite due to bad souce-location information. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126721 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index a059e0b75a..823c08c999 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -221,8 +221,12 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, TemplateArgsPtr, TemplateId->RAngleLoc, CCLoc, - EnteringContext)) - SS.SetInvalid(SourceRange(SS.getBeginLoc(), CCLoc)); + EnteringContext)) { + SourceLocation StartLoc + = SS.getBeginLoc().isValid()? SS.getBeginLoc() + : TemplateId->TemplateNameLoc; + SS.SetInvalid(SourceRange(StartLoc, CCLoc)); + } TemplateId->Destroy(); continue;