[PATCH] D26406: Add -Wduplicate-protocol for existing diagnostic
Dave Lee via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 8 10:30:17 PST 2016
kastiglione created this revision.
kastiglione added a reviewer: cfe-commits.
Expose a warning flag for `warn_duplicate_protocol_def`. This allows control
over the severity of duplicate protocol definitions.
For example `-Werror=duplicate-protocol` or
`#pragma clang diagnostic ignored "-Wduplicate-protocol"`.
https://reviews.llvm.org/D26406
Files:
include/clang/Basic/DiagnosticSemaKinds.td
test/Misc/warning-flags.c
Index: test/Misc/warning-flags.c
===================================================================
--- test/Misc/warning-flags.c
+++ test/Misc/warning-flags.c
@@ -18,7 +18,7 @@
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (83):
+CHECK: Warnings without flags (82):
CHECK-NEXT: ext_excess_initializers
CHECK-NEXT: ext_excess_initializers_in_char_array_initializer
CHECK-NEXT: ext_expected_semi_decl_list
@@ -58,7 +58,6 @@
CHECK-NEXT: warn_drv_objc_gc_unsupported
CHECK-NEXT: warn_drv_pch_not_first_include
CHECK-NEXT: warn_dup_category_def
-CHECK-NEXT: warn_duplicate_protocol_def
CHECK-NEXT: warn_enum_value_overflow
CHECK-NEXT: warn_expected_qualified_after_typename
CHECK-NEXT: warn_extraneous_char_constant
Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -739,7 +739,8 @@
"trying to recursively use %0 as superclass of %1">;
def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
-def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
+def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">,
+ InGroup<DiagGroup<"duplicate-protocol">>;
def err_protocol_has_circular_dependency : Error<
"protocol has circular dependency">;
def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26406.77211.patch
Type: text/x-patch
Size: 1664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161108/a5e5c5cf/attachment.bin>
More information about the cfe-commits
mailing list