Enhance 'diagtool list-warnings' to report number of diagnostics covered directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159893 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c
index 15b2d27..4edd77d 100644
--- a/test/Misc/warning-flags.c
+++ b/test/Misc/warning-flags.c
@@ -177,3 +177,8 @@
CHECK-NEXT: warn_weak_identifier_undeclared
CHECK-NEXT: warn_weak_import
+The list of warnings in -Wpedenatic should NEVER grow.
+
+CHECK: Number in -Wpedantic (not covered by other -W flags): 71
+
+
diff --git a/tools/diagtool/ListWarnings.cpp b/tools/diagtool/ListWarnings.cpp
index d59ffaa..d554a2e 100644
--- a/tools/diagtool/ListWarnings.cpp
+++ b/tools/diagtool/ListWarnings.cpp
@@ -98,6 +98,10 @@
out << " Average number of diagnostics per flag: "
<< llvm::format("%.4g", avgDiagsPerFlag) << '\n';
+ out << " Number in -Wpedantic (not covered by other -W flags): "
+ << flagHistogram.GetOrCreateValue("pedantic").getValue().size()
+ << '\n';
+
out << '\n';
return 0;