Fixed source range for extern linkage specification without braces.

llvm-svn: 130660
This commit is contained in:
Abramo Bagnara 2011-05-01 16:25:54 +00:00
parent 9af3d4b193
commit 4d42399d46
1 changed files with 5 additions and 0 deletions

View 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,