diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-10 22:35:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-10 22:35:27 +0000 |
commit | d97d35e1500d98f4f50938c5ecae98a1301a9a10 (patch) | |
tree | a25dd0bc78652222302147ca3b1cb546f9b7c6ad /clang/lib/Parse/Parser.cpp | |
parent | 149178d92bf4d405e71fabb4d93204292f89acc2 (diff) | |
download | llvm-d97d35e1500d98f4f50938c5ecae98a1301a9a10.zip llvm-d97d35e1500d98f4f50938c5ecae98a1301a9a10.tar.gz llvm-d97d35e1500d98f4f50938c5ecae98a1301a9a10.tar.bz2 |
[Modules TS] Diagnose attempts to enter module implementation units without the module interface being available.
llvm-svn: 315381
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 682c481..e24735d 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -2048,7 +2048,7 @@ Parser::DeclGroupPtrTy Parser::ParseModuleDecl() { SourceLocation StartLoc = Tok.getLocation(); Sema::ModuleDeclKind MDK = TryConsumeToken(tok::kw_export) - ? Sema::ModuleDeclKind::Module + ? Sema::ModuleDeclKind::Interface : Sema::ModuleDeclKind::Implementation; assert(Tok.is(tok::kw_module) && "not a module declaration"); @@ -2057,7 +2057,7 @@ Parser::DeclGroupPtrTy Parser::ParseModuleDecl() { if (Tok.is(tok::identifier) && NextToken().is(tok::identifier) && Tok.getIdentifierInfo()->isStr("partition")) { // If 'partition' is present, this must be a module interface unit. - if (MDK != Sema::ModuleDeclKind::Module) + if (MDK != Sema::ModuleDeclKind::Interface) Diag(Tok.getLocation(), diag::err_module_implementation_partition) << FixItHint::CreateInsertion(ModuleLoc, "export "); MDK = Sema::ModuleDeclKind::Partition; |