From ad646846f7033d3ee813998bb0bc028aee51e65e Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi <geek4civic@gmail.com>
Date: Sat, 17 Dec 2011 13:00:31 +0000
Subject: [PATCH] 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:

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146830 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Frontend/VerifyDiagnosticConsumer.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp
index 96c990c54f2..88e36ade579 100644
--- a/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -459,10 +459,10 @@ static unsigned CheckLists(DiagnosticsEngine &Diags, SourceManager &SourceMgr,
     }
   }
   // 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
-- 
GitLab