Skip to content

Commit

Permalink
[clang][sema] Add missing diagnostic parameter
Browse files Browse the repository at this point in the history
The test case otherwise fails an assertion in Diagnostic::getArgKind().

Differential Revision: https://reviews.llvm.org/D116595
  • Loading branch information
tbaederr committed Jan 24, 2022
1 parent 9aaa74a commit ba84578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaModule.cpp
Expand Up @@ -395,7 +395,7 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
// [module.interface]p1:
// An export-declaration shall inhabit a namespace scope and appear in the
// purview of a module interface unit.
Diag(ExportLoc, diag::err_export_not_in_module_interface);
Diag(ExportLoc, diag::err_export_not_in_module_interface) << 0;
}

return Import;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Modules/cxx20-export-import.cpp
@@ -0,0 +1,3 @@

// RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify %s
export import dummy; // expected-error {{export declaration can only be used within a module interface unit after the module declaration}}

0 comments on commit ba84578

Please sign in to comment.