diff options
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 6 | ||||
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 17 |
3 files changed, 20 insertions, 6 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 1d55d6e50d..cc958dbdfe 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -332,8 +332,7 @@ def err_feature_check_malformed : Error< "builtin feature check macro requires a parenthesized identifier">; def err_warning_check_malformed : Error< - "builtin warning check macro requires a parenthesized string">, - InGroup<MalformedWarningCheck>; + "builtin warning check macro requires a parenthesized string">; def warn_has_warning_invalid_option : ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">, InGroup<MalformedWarningCheck>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 13c0d525af..4d5882f329 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3567,8 +3567,7 @@ def err_arc_autoreleasing_capture : Error< def err_arc_thread_ownership : Error< "thread-local variable has non-trivial ownership: type is %0">; def err_arc_indirect_no_ownership : Error< - "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">, - InGroup<AutomaticReferenceCounting>; + "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">; def err_arc_array_param_no_ownership : Error< "must explicitly describe intended ownership of an object array parameter">; def err_arc_pseudo_dtor_inconstant_quals : Error< @@ -5491,8 +5490,7 @@ def err_builtin_annotation_second_arg : Error< // CFString checking def err_cfstring_literal_not_string_constant : Error< - "CFString literal is not a string constant">, - InGroup<DiagGroup<"CFString-literal">>; + "CFString literal is not a string constant">; def warn_cfstring_truncated : Warning< "input conversion stopped due to an input byte that does not " "belong to the input codeset UTF-8">, diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 0e3527f7c9..e503cb587d 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -339,6 +339,11 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic, // Warning Tables (.inc file) generation. //===----------------------------------------------------------------------===// +static bool isError(const Record &Diag) { + const std::string &ClsName = Diag.getValueAsDef("Class")->getName(); + return ClsName == "CLASS_ERROR"; +} + /// ClangDiagsDefsEmitter - The top-level class emits .def files containing /// declarations of Clang diagnostics. namespace clang { @@ -373,6 +378,18 @@ void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS, for (unsigned i = 0, e = Diags.size(); i != e; ++i) { const Record &R = *Diags[i]; + + // Check if this is an error that is accidentally in a warning + // group. + if (isError(R)) { + if (DefInit *Group = dynamic_cast<DefInit*>(R.getValueInit("Group"))) { + const Record *GroupRec = Group->getDef(); + const std::string &GroupName = GroupRec->getValueAsString("GroupName"); + throw "Error " + R.getName() + " cannot be in a warning group [" + + GroupName + "]"; + } + } + // Filter by component. if (!Component.empty() && Component != R.getValueAsString("Component")) continue; |