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">;
915
915
def warn_mmap_link_redeclaration : Warning<"redeclaration of link library '%0'">,
916
916
InGroup<DiagGroup<"module-link-redeclaration">>, DefaultError;
917
917
def 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;
920
922
def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">,
921
923
InGroup<IgnoredAttributes>;
922
924
def 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(
856
856
// Make sure we eat all the tokens when we report the errors so parsing
857
857
// can continue.
858
858
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);
862
860
}
863
861
864
862
auto [It, Inserted] =
865
863
SeenLinkDecl.insert (std::make_pair (Library, LD.Location ));
866
864
if (!Inserted) {
867
865
Diags.Report (LD.Location , diag::warn_mmap_link_redeclaration) << Library;
868
866
Diags.Report (It->second , diag::note_mmap_prev_link_declaration);
869
- HadError = true ;
870
- return std::nullopt;
871
867
}
872
868
873
869
return std::move (LD);
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ module C {
51
51
52
52
// Note that module D does not report an error because it is explicit.
53
53
// 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]
55
55
// CHECK-NEXT: module.modulemap:15:3: error: redeclaration of link library 'libraryA' [-Wmodule-link-redeclaration]
56
56
// CHECK-NEXT: module.modulemap:14:3: note: previously declared here
57
57
// CHECK-NOT: module.modulemap:20:3: error: redeclaration of link library 'libraryA'
You can’t perform that action at this time.
0 commit comments