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
diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp
index 96c990c..88e36ad 100644
--- a/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -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