================
@@ -547,11 +547,9 @@ void 
WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
     StringRef DiagGroup = SectionEntry->getKey();
     if (Diags.getDiagnosticIDs()->getDiagnosticsInGroup(
             WarningFlavor, DiagGroup, GroupDiags)) {
-      StringRef Suggestion =
-          DiagnosticIDs::getNearestOption(WarningFlavor, DiagGroup);
-      Diags.Report(diag::warn_unknown_diag_option)
-          << static_cast<unsigned>(WarningFlavor) << DiagGroup
-          << !Suggestion.empty() << Suggestion;
+      // If a diagnostic group name is unknown, simply ignore the
----------------
kadircet wrote:

it's intentional to emit these warnings so can we keep that but rather make 
sure we do respect rest of the warning options?

we can do that by moving 
https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/Warnings.cpp#L76-L84
 past processing of other warning flags.

in addition to that, we should propagate `ReportDiags` into 
`DiagnosticsEngine::setDiagSuppressionMapping` and not emit warnings when it's 
set to false (to prevent double emitting in driver & cc1).

this is more of a FR, but we should also use source-manager and attach 
source-location to these warnings.

--

I am happy to do these changes myself, as they're more involved then what's in 
this PR currently. PLMK if you'd prefer that.

https://github.com/llvm/llvm-project/pull/124141
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to