From e35f9ddb4cd5f33b0484c4371290e27b8a0ea485 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 15 Nov 2011 18:57:32 +0000 Subject: [PATCH] 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 llvm-svn: 144670 --- clang/lib/Frontend/Warnings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/Warnings.cpp b/clang/lib/Frontend/Warnings.cpp index 4e41e22138c7..3588af0d4a44 100644 --- a/clang/lib/Frontend/Warnings.cpp +++ b/clang/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); }