[cfe-commits] r99178 - /cfe/trunk/lib/Basic/Diagnostic.cpp

Douglas Gregor dgregor at apple.com
Mon Mar 22 08:47:45 PDT 2010


Author: dgregor
Date: Mon Mar 22 10:47:45 2010
New Revision: 99178

URL: http://llvm.org/viewvc/llvm-project?rev=99178&view=rev
Log:
Fix a thinko and a typo in the delayed-diagnostic code.


Modified:
    cfe/trunk/lib/Basic/Diagnostic.cpp

Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=99178&r1=99177&r2=99178&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Mon Mar 22 10:47:45 2010
@@ -297,8 +297,8 @@
     return;
 
   DelayedDiagID = DiagID;
-  DelayedDiagArg1 = Arg1;
-  DelayedDiagArg1 = Arg2;
+  DelayedDiagArg1 = Arg1.str();
+  DelayedDiagArg2 = Arg2.str();
 }
 
 void Diagnostic::ReportDelayed() {
@@ -567,10 +567,11 @@
   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.





More information about the cfe-commits mailing list