summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 19bfeeea72a..6b7f732b3f0 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -382,7 +382,20 @@ Diagnostic::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const {
// If warnings are globally mapped to ignore or error, do it.
if (IgnoreAllWarnings)
return Diagnostic::Ignored;
- Result = WarningsAsErrors ? Diagnostic::Error : Diagnostic::Warning;
+
+ Result = Diagnostic::Warning;
+ if (WarningsAsErrors)
+ Result = Diagnostic::Error;
+ break;
+ case diag::MAP_WARNING_NO_WERROR:
+ // Diagnostics specified with -Wno-error=foo should be set to warnings, but
+ // not be adjusted by -Werror or -pedantic-errors.
+ Result = Diagnostic::Warning;
+
+ // If warnings are globally mapped to ignore or error, do it.
+ if (IgnoreAllWarnings)
+ return Diagnostic::Ignored;
+
break;
}
OpenPOWER on IntegriCloud