summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 227c175dc0c..31d3b34c816 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud