aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-07-08 10:52:01 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-07-08 10:52:01 +0000
commitfbc94213f38c48154ddc448b527f667182abe954 (patch)
treee354f8b802544fa55110df46a4be8c8850e4df82
parent7d5c45ed9dc2842ce8e65ea26ced0957be36a569 (diff)
Wrap the new ext-warn on extraneous comma on the last entry of an enumerator
list in a diagnostic group so it can be turned on and off. A terrifying amount of code, including large chunks of open source code, still do this so it's important to be able to suppress it when necessary. Doug, is this a reasonable compromise? I'd lean toward making it a normal extension, but I don't feel strongly as long as we can turn the warnings off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107865 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticGroups.td1
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td
index 8572c62e4b..9b4c939a95 100644
--- a/include/clang/Basic/DiagnosticGroups.td
+++ b/include/clang/Basic/DiagnosticGroups.td
@@ -38,6 +38,7 @@ def : DiagGroup<"disabled-optimization">;
def : DiagGroup<"discard-qual">;
def : DiagGroup<"div-by-zero">;
def EmptyBody : DiagGroup<"empty-body">;
+def EnumeratorListComma : DiagGroup<"enumerator-list-comma">;
def ExtraTokens : DiagGroup<"extra-tokens">;
def FormatExtraArgs : DiagGroup<"format-extra-args">;
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index 63f53a1aef..734b414b51 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -53,7 +53,7 @@ def ext_c99_compound_literal : Extension<
"compound literals are a C99-specific feature">;
def ext_enumerator_list_comma : ExtWarn<
"commas at the end of enumerator lists are a %select{C99|C++0x}0-specific "
- "feature">;
+ "feature">, InGroup<EnumeratorListComma>;
def ext_gnu_indirect_goto : Extension<
"use of GNU indirect-goto extension">, InGroup<GNU>;