aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-22 15:47:45 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-22 15:47:45 +0000
commit9e2dac9c9b6bc4384c816a447cca6516a03c89f2 (patch)
tree40dac9417680726174a57a34ccf61eefa516fcd6
parent253942158cd75fc9061e384aeba589cc8bb5f0c5 (diff)
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
-rw-r--r--lib/Basic/Diagnostic.cpp7
1 files 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.