aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-04-15 23:55:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-04-15 23:55:58 +0000
commit728780bfadfeae6dd9b7124d490be7d9f6c33de6 (patch)
treec6bdf4a5566b11b5b1889224f4c1f0e4306d0c58 /clang/lib/Parse/Parser.cpp
parente4b19c9c28687eb58ea61f2d5da587f6e7bcd7bf (diff)
downloadllvm-728780bfadfeae6dd9b7124d490be7d9f6c33de6.zip
llvm-728780bfadfeae6dd9b7124d490be7d9f6c33de6.tar.gz
llvm-728780bfadfeae6dd9b7124d490be7d9f6c33de6.tar.bz2
Simplify diagnosis of misplaced attributes in module-declarations.
No functional change intended. llvm-svn: 358463
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index febb0f9..6b25d6c 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -2170,8 +2170,8 @@ Parser::DeclGroupPtrTy Parser::ParseModuleDecl(bool IsFirstDecl) {
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::ParseModuleDecl(bool IsFirstDecl) {
}
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);
}