Add EXTWARN Diagnostic class.
- Like EXTENSION but always generates a warning (even without
-pedantic).
- Updated ptr -> int, int -> ptr, and incompatible cast warnings to
be EXTWARN.
- Other EXTENSION level diagnostics should be audited for upgrade.
- Updated several test cases to fix code which produced unanticipated
warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54335 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index fbf118f..35d665d 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -29,7 +29,8 @@
NOTE = 0x01,
WARNING = 0x02,
EXTENSION = 0x03,
- ERROR = 0x04,
+ EXTWARN = 0x04,
+ ERROR = 0x05,
class_mask = 0x07
};
@@ -182,6 +183,8 @@
DiagClass = WARNING;
else
return Ignored;
+ } else if (DiagClass == EXTWARN) {
+ DiagClass = ErrorOnExtensions ? ERROR : WARNING;
}
// If warnings are globally mapped to ignore or error, do it.