[cfe-commits] r146830 - /cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp

NAKAMURA Takumi geek4civic at gmail.com
Sat Dec 17 05:00:32 PST 2011


Author: chapuni
Date: Sat Dec 17 07:00:31 2011
New Revision: 146830

URL: http://llvm.org/viewvc/llvm-project?rev=146830&view=rev
Log:
Frontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.

It had been causing test "Misc/diag-verify.cpp" failure on ms cl.exe. The emission was ordered unexpectedly as below;

First)  error: 'error' diagnostics seen but not expected:
Second) error: 'error' diagnostics expected but not seen:

Modified:
    cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp

Modified: cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp?rev=146830&r1=146829&r2=146830&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp Sat Dec 17 07:00:31 2011
@@ -459,10 +459,10 @@
     }
   }
   // Now all that's left in Right are those that were not matched.
-
-  return (PrintProblem(Diags, &SourceMgr, LeftOnly, Label, true) +
-          PrintProblem(Diags, &SourceMgr, Right.begin(), Right.end(),
-                       Label, false));
+  unsigned num = PrintProblem(Diags, &SourceMgr, LeftOnly, Label, true);
+  num += PrintProblem(Diags, &SourceMgr, Right.begin(), Right.end(),
+                      Label, false);
+  return num;
 }
 
 /// CheckResults - This compares the expected results to those that





More information about the cfe-commits mailing list