From: Chad Rosier Date: Tue, 15 Nov 2011 18:57:32 +0000 (+0000) Subject: Fix a regression from 143657. The second pass of the warning options should only... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=496cc8eae2c69b8fd36a2b3e815dd0e8207ec493;p=clang Fix a regression from 143657. The second pass of the warning options should only be emitting warnings/errors for unknown warning options. getDiagnosticsInGroup returns false if the diagnostics is found and true otherwise. Thus, if we're reporting and we have a valid diagnostic, we were actually setting the flag and causing mayhem. rdar://10444207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144670 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/Warnings.cpp b/lib/Frontend/Warnings.cpp index 4e41e22138..3588af0d4a 100644 --- a/lib/Frontend/Warnings.cpp +++ b/lib/Frontend/Warnings.cpp @@ -166,8 +166,9 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, continue; } - if (Report && DiagIDs->getDiagnosticsInGroup(Opt, _Diags)) { - EmitUnkownDiagWarning(Diags, "-W", Opt, isPositive); + if (Report) { + if (DiagIDs->getDiagnosticsInGroup(Opt, _Diags)) + EmitUnkownDiagWarning(Diags, "-W", Opt, isPositive); } else { Diags.setDiagnosticGroupMapping(Opt, Mapping); }