]> granicus.if.org Git - clang/commitdiff
Fixed source range for extern linkage specification without braces.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Sun, 1 May 2011 16:25:54 +0000 (16:25 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Sun, 1 May 2011 16:25:54 +0000 (16:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130660 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp

index df2d214cb9397cf8ff0afcd21ac66ae84c4f368c..8c0aa1ba694ce60f4fa25f40fa9e932e24e687db 100644 (file)
@@ -202,6 +202,11 @@ Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, unsigned Context) {
   MaybeParseMicrosoftAttributes(attrs);
 
   if (Tok.isNot(tok::l_brace)) {
+    // Reset the source range in DS, as the leading "extern"
+    // does not really belong to the inner declaration ...
+    DS.SetRangeStart(SourceLocation());
+    DS.SetRangeEnd(SourceLocation());
+    // ... but anyway remember that such an "extern" was seen.
     DS.setExternInLinkageSpec(true);
     ParseExternalDeclaration(attrs, &DS);
     return Actions.ActOnFinishLinkageSpecification(getCurScope(), LinkageSpec,