diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-23 22:57:55 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-23 22:57:55 +0000 |
commit | fbe3adf10ec9e3dd5ab282d2a4d8660fee47afc9 (patch) | |
tree | 98acc383e861b4792baac772cb1978f4eff66e3a /clang/lib/Frontend/TextDiagnostic.cpp | |
parent | 91269bfd7a36a5fac6416b4ce28dd98b7411ceb0 (diff) | |
download | bcm5719-llvm-fbe3adf10ec9e3dd5ab282d2a4d8660fee47afc9.tar.gz bcm5719-llvm-fbe3adf10ec9e3dd5ab282d2a4d8660fee47afc9.zip |
clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
Remove tests that have neither a triple nor an explicit -fmsc-version flag,
since in the absence of an -fmsc-version flag, the implicit value of the flag
is 17 (MSVC2013) with MSVC triples but 0 (not set) for other triples, and
the default triple is platform dependent.
This relands r263974 with a test fix.
llvm-svn: 264210
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()) { |