forked from OSchip/llvm-project
Fix assertion failure when parsing linkage specifications (PR5921),
from Keir Mierle! llvm-svn: 95516
This commit is contained in:
parent
e83b3aca0b
commit
b65a913c35
|
@ -191,6 +191,8 @@ Parser::DeclPtrTy Parser::ParseLinkage(ParsingDeclSpec &DS,
|
|||
SourceLocation());
|
||||
}
|
||||
|
||||
DS.abort();
|
||||
|
||||
if (Attr.HasAttr)
|
||||
Diag(Attr.Range.getBegin(), diag::err_attributes_not_allowed)
|
||||
<< Attr.Range;
|
||||
|
|
|
@ -593,7 +593,6 @@ Parser::ParseDeclarationOrFunctionDefinition(ParsingDeclSpec &DS,
|
|||
if (Tok.is(tok::string_literal) && getLang().CPlusPlus &&
|
||||
DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
|
||||
DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) {
|
||||
DS.abort();
|
||||
DeclPtrTy TheDecl = ParseLinkage(DS, Declarator::FileContext);
|
||||
return Actions.ConvertDeclToDeclGroup(TheDecl);
|
||||
}
|
||||
|
|
|
@ -10,4 +10,7 @@ extern int b;
|
|||
// RUN: grep "@_ZN3foo1cE = global i32" %t | count 1
|
||||
int c = 5;
|
||||
|
||||
// RUN: not grep "@_ZN3foo1dE" %t
|
||||
extern "C" struct d;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue