File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -915,8 +915,10 @@ def err_mmap_expected_attribute : Error<"expected an attribute name">;
915915def warn_mmap_link_redeclaration : Warning<"redeclaration of link library '%0'">,
916916 InGroup<DiagGroup<"module-link-redeclaration">>, DefaultError;
917917def note_mmap_prev_link_declaration : Note<"previously declared here">;
918- def err_mmap_submodule_link_decl
919- : Error<"link declaration is not allowed in submodules">;
918+ def warn_mmap_submodule_link_decl
919+ : Warning<"link declaration is not allowed in submodules">,
920+ InGroup<DiagGroup<"module-submodule-link-decl">>,
921+ DefaultError;
920922def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
921923 InGroup<IgnoredAttributes>;
922924def warn_mmap_mismatched_private_submodule : Warning<
Original file line number Diff line number Diff line change @@ -856,18 +856,14 @@ std::optional<LinkDecl> ModuleMapFileParser::parseLinkDecl(
856856 // Make sure we eat all the tokens when we report the errors so parsing
857857 // can continue.
858858 if (!Allowed) {
859- Diags.Report (LD.Location , diag::err_mmap_submodule_link_decl);
860- HadError = true ;
861- return std::nullopt ;
859+ Diags.Report (LD.Location , diag::warn_mmap_submodule_link_decl);
862860 }
863861
864862 auto [It, Inserted] =
865863 SeenLinkDecl.insert (std::make_pair (Library, LD.Location ));
866864 if (!Inserted) {
867865 Diags.Report (LD.Location , diag::warn_mmap_link_redeclaration) << Library;
868866 Diags.Report (It->second , diag::note_mmap_prev_link_declaration);
869- HadError = true ;
870- return std::nullopt ;
871867 }
872868
873869 return std::move (LD);
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ module C {
5151
5252// Note that module D does not report an error because it is explicit.
5353// Therefore we can use CHECK-NEXT for the redeclaration error on line 15.
54- // CHECK: module.modulemap:6:5: error: link declaration is not allowed in submodules
54+ // CHECK: module.modulemap:6:5: error: link declaration is not allowed in submodules [-Wmodule-submodule-link-decl]
5555// CHECK-NEXT: module.modulemap:15:3: error: redeclaration of link library 'libraryA' [-Wmodule-link-redeclaration]
5656// CHECK-NEXT: module.modulemap:14:3: note: previously declared here
5757// CHECK-NOT: module.modulemap:20:3: error: redeclaration of link library 'libraryA'
You can’t perform that action at this time.
0 commit comments