From 9e2dac9c9b6bc4384c816a447cca6516a03c89f2 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 22 Mar 2010 15:47:45 +0000 Subject: [PATCH] Fix a thinko and a typo in the delayed-diagnostic code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99178 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Diagnostic.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 227c175dc0..31d3b34c81 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -297,8 +297,8 @@ void Diagnostic::SetDelayedDiagnostic(unsigned DiagID, llvm::StringRef Arg1, return; DelayedDiagID = DiagID; - DelayedDiagArg1 = Arg1; - DelayedDiagArg1 = Arg2; + DelayedDiagArg1 = Arg1.str(); + DelayedDiagArg2 = Arg2.str(); } void Diagnostic::ReportDelayed() { @@ -567,10 +567,11 @@ bool DiagnosticBuilder::Emit() { bool Emitted = DiagObj->ProcessDiag(); // Clear out the current diagnostic object. + unsigned DiagID = DiagObj->CurDiagID; DiagObj->Clear(); // If there was a delayed diagnostic, emit it now. - if (DiagObj->DelayedDiagID) + if (DiagObj->DelayedDiagID && DiagObj->DelayedDiagID != DiagID) DiagObj->ReportDelayed(); // This diagnostic is dead. -- 2.50.1