Skip to content

Commit 5988354

Browse files
committed
Address code review.
1 parent bf8a718 commit 5988354

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,8 @@ def err_mmap_nested_submodule_id : Error<
909909
"qualified module name can only be used to define modules at the top level">;
910910
def err_mmap_expected_feature : Error<"expected a feature name">;
911911
def err_mmap_expected_attribute : Error<"expected an attribute name">;
912-
def err_mmap_link_redecalration : Error<"redeclaration of link library '%0'">;
912+
def warn_mmap_link_redeclaration : Warning<"redeclaration of link library '%0'">,
913+
InGroup<DiagGroup<"module-link-redeclaration">>, DefaultError;
913914
def note_mmap_prev_link_declaration : Note<"previously declared here">;
914915
def err_mmap_submodule_link_decl
915916
: Error<"link declaration is not allowed in submodules">;

clang/lib/Lex/ModuleMapFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ std::optional<LinkDecl> ModuleMapFileParser::parseLinkDecl(
864864
auto [It, Inserted] =
865865
SeenLinkDecl.insert(std::make_pair(Library, LD.Location));
866866
if (!Inserted) {
867-
Diags.Report(LD.Location, diag::err_mmap_link_redecalration) << Library;
867+
Diags.Report(LD.Location, diag::warn_mmap_link_redeclaration) << Library;
868868
Diags.Report(It->second, diag::note_mmap_prev_link_declaration);
869869
HadError = true;
870870
return std::nullopt;

0 commit comments

Comments
 (0)