forked from OSchip/llvm-project
Simplify diagnosis of misplaced attributes in module-declarations.
No functional change intended. llvm-svn: 358463
This commit is contained in:
parent
e4b19c9c28
commit
728780bfad
|
@ -2170,8 +2170,8 @@ Parser::DeclGroupPtrTy Parser::ParseModuleDecl(bool IsFirstDecl) {
|
||||||
SourceLocation ModuleLoc = ConsumeToken();
|
SourceLocation ModuleLoc = ConsumeToken();
|
||||||
|
|
||||||
// Attributes appear after the module name, not before.
|
// Attributes appear after the module name, not before.
|
||||||
if (Tok.is(tok::l_square))
|
// FIXME: Suggest moving the attributes later with a fixit.
|
||||||
CheckProhibitedCXX11Attribute();
|
DiagnoseAndSkipCXX11Attributes();
|
||||||
|
|
||||||
// Parse a global-module-fragment, if present.
|
// Parse a global-module-fragment, if present.
|
||||||
if (getLangOpts().CPlusPlusModules && Tok.is(tok::semi)) {
|
if (getLangOpts().CPlusPlusModules && Tok.is(tok::semi)) {
|
||||||
|
@ -2197,8 +2197,7 @@ Parser::DeclGroupPtrTy Parser::ParseModuleDecl(bool IsFirstDecl) {
|
||||||
}
|
}
|
||||||
ConsumeToken();
|
ConsumeToken();
|
||||||
SourceLocation PrivateLoc = ConsumeToken();
|
SourceLocation PrivateLoc = ConsumeToken();
|
||||||
if (Tok.is(tok::l_square))
|
DiagnoseAndSkipCXX11Attributes();
|
||||||
CheckProhibitedCXX11Attribute();
|
|
||||||
ExpectAndConsumeSemi(diag::err_private_module_fragment_expected_semi);
|
ExpectAndConsumeSemi(diag::err_private_module_fragment_expected_semi);
|
||||||
return Actions.ActOnPrivateModuleFragmentDecl(ModuleLoc, PrivateLoc);
|
return Actions.ActOnPrivateModuleFragmentDecl(ModuleLoc, PrivateLoc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue