]> granicus.if.org Git - clang/commitdiff
Make sure to give CXXScopeSpec::SetInvalid() a valid source
authorDouglas Gregor <dgregor@apple.com>
Fri, 25 Feb 2011 16:51:05 +0000 (16:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 25 Feb 2011 16:51:05 +0000 (16:51 +0000)
range. Fixes four new failures in the GCC testsuite.

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

lib/Parse/ParseExprCXX.cpp

index 2abec6f0cc5ccd769f69131673cc46a203602384..d8db711809edbefdbc64b9d8551204b9c14ec1ef 100644 (file)
@@ -217,7 +217,9 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
           
           continue;
         } else {
-          SS.SetInvalid(SourceRange(SS.getBeginLoc(), CCLoc));
+          SourceLocation Start = SS.getBeginLoc().isValid()? SS.getBeginLoc() 
+                                                           : CCLoc;
+          SS.SetInvalid(SourceRange(Start, CCLoc));
         }
         
         continue;