From: Abramo Bagnara Date: Sun, 1 May 2011 16:25:54 +0000 (+0000) Subject: Fixed source range for extern linkage specification without braces. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f41e33c29cd4b21065956129d5e923f3d73d97d3;p=clang Fixed source range for extern linkage specification without braces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130660 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index df2d214cb9..8c0aa1ba69 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -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,