Author: rsmith Date: Mon Apr 15 16:55:58 2019 New Revision: 358463 URL: http://llvm.org/viewvc/llvm-project?rev=358463&view=rev Log: Simplify diagnosis of misplaced attributes in module-declarations.
No functional change intended. Modified: cfe/trunk/lib/Parse/Parser.cpp Modified: cfe/trunk/lib/Parse/Parser.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=358463&r1=358462&r2=358463&view=diff ============================================================================== --- cfe/trunk/lib/Parse/Parser.cpp (original) +++ cfe/trunk/lib/Parse/Parser.cpp Mon Apr 15 16:55:58 2019 @@ -2170,8 +2170,8 @@ Parser::DeclGroupPtrTy Parser::ParseModu SourceLocation ModuleLoc = ConsumeToken(); // Attributes appear after the module name, not before. - if (Tok.is(tok::l_square)) - CheckProhibitedCXX11Attribute(); + // FIXME: Suggest moving the attributes later with a fixit. + DiagnoseAndSkipCXX11Attributes(); // Parse a global-module-fragment, if present. if (getLangOpts().CPlusPlusModules && Tok.is(tok::semi)) { @@ -2197,8 +2197,7 @@ Parser::DeclGroupPtrTy Parser::ParseModu } ConsumeToken(); SourceLocation PrivateLoc = ConsumeToken(); - if (Tok.is(tok::l_square)) - CheckProhibitedCXX11Attribute(); + DiagnoseAndSkipCXX11Attributes(); ExpectAndConsumeSemi(diag::err_private_module_fragment_expected_semi); return Actions.ActOnPrivateModuleFragmentDecl(ModuleLoc, PrivateLoc); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits