summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnostic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/TextDiagnostic.cpp')
-rw-r--r--clang/lib/Frontend/TextDiagnostic.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index 5dda151d558..fdaf44d77b3 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -819,7 +819,15 @@ void TextDiagnostic::emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
switch (DiagOpts->getFormat()) {
case DiagnosticOptions::Clang:
case DiagnosticOptions::Vi: OS << ':'; break;
- case DiagnosticOptions::MSVC: OS << ") : "; break;
+ case DiagnosticOptions::MSVC:
+ // MSVC2013 and before print 'file(4) : error'. MSVC2015 gets rid of the
+ // space and prints 'file(4): error'.
+ OS << ')';
+ if (LangOpts.MSCompatibilityVersion &&
+ !LangOpts.isCompatibleWithMSVC(LangOptions::MSVC2015))
+ OS << ' ';
+ OS << ": ";
+ break;
}
if (DiagOpts->ShowSourceRanges && !Ranges.empty()) {
OpenPOWER on IntegriCloud