]> granicus.if.org Git - clang/commitdiff
Fix some regressions in the GCC testsuite due to bad souce-location
authorDouglas Gregor <dgregor@apple.com>
Tue, 1 Mar 2011 00:34:57 +0000 (00:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 1 Mar 2011 00:34:57 +0000 (00:34 +0000)
information. Fixes <rdar://problem/9063643>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126721 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExprCXX.cpp

index a059e0b75a8b81ec42354848337cdbcc3e0e5bb7..823c08c999d53b1c3a56d75cad4938582b2d9f43 100644 (file)
@@ -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;