diff options
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 77984d6a09..5835e75c1a 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -209,6 +209,9 @@ void Diagnostic::Report(DiagnosticClient* C, // If the client doesn't care about this message, don't issue it. if (DiagLevel == Diagnostic::Ignored) return; + + // Set the diagnostic client if it isn't set already. + if (!C) C = &Client; // If this is not an error and we are in a system header, ignore it. We have // to check on the original class here, because we also want to ignore @@ -228,8 +231,6 @@ void Diagnostic::Report(DiagnosticClient* C, // Finally, report it. - if (!C) C = &Client; - C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID, Strs, NumStrs, Ranges, NumRanges); |