diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-21 19:44:18 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-21 19:44:18 +0000 |
commit | 920341c7a987cd925ccc16693020e405d90d62c2 (patch) | |
tree | a70826980e73fb66cf4188b91513f25d796646ac /clang/lib/Frontend/TextDiagnostic.cpp | |
parent | a4192a743aa8d8be10f1919c573e301516a177cc (diff) | |
download | bcm5719-llvm-920341c7a987cd925ccc16693020e405d90d62c2.tar.gz bcm5719-llvm-920341c7a987cd925ccc16693020e405d90d62c2.zip |
clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
llvm-svn: 263974
Diffstat (limited to 'clang/lib/Frontend/TextDiagnostic.cpp')
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 10 |
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()) { |