From: Matt Beaumont-Gay Date: Fri, 23 Sep 2011 20:56:58 +0000 (+0000) Subject: Add DiagGroups to a couple of warnings. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f163424152259f5dafe6ccc696c97a80fc504fc;p=clang Add DiagGroups to a couple of warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140411 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 509f29e1a5..16afc978bc 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -66,6 +66,7 @@ def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">; def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">; def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">; def : DiagGroup<"import">; +def IncompatiblePointerTypes : DiagGroup<"incompatible-pointer-types">; def : DiagGroup<"init-self">; def : DiagGroup<"inline">; def : DiagGroup<"int-to-pointer-cast">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index b0f6c938f8..0dd84d221d 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3785,19 +3785,21 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn< "take the address with &|" "remove *|" "remove &}3">, - InGroup>; + InGroup; def ext_typecheck_convert_discards_qualifiers : ExtWarn< "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" " %0 " "%select{from|to parameter of type|from a function with result type|to type|" "with an expression of type|to parameter of type|to type}2 %1 discards " - "qualifiers">; + "qualifiers">, + InGroup; def ext_nested_pointer_qualifier_mismatch : ExtWarn< "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" " %0 " "%select{from|to parameter of type|from a function with result type|to type|" "with an expression of type|to parameter of type|to type}2 %1 discards " - "qualifiers in nested pointer types">; + "qualifiers in nested pointer types">, + InGroup; def warn_incompatible_vectors : Warning< "incompatible vector types " "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" @@ -3941,9 +3943,11 @@ def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn< def err_cast_selector_expr : Error< "cannot type cast @selector expression">; def warn_typecheck_cond_incompatible_pointers : ExtWarn< - "pointer type mismatch (%0 and %1)">; + "pointer type mismatch (%0 and %1)">, + InGroup>; def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn< - "pointer/integer type mismatch in conditional expression (%0 and %1)">; + "pointer/integer type mismatch in conditional expression (%0 and %1)">, + InGroup>; def err_typecheck_choose_expr_requires_constant : Error< "'__builtin_choose_expr' requires a constant expression">; def ext_typecheck_expression_not_constant_but_accepted : Extension< diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 5b6bac49e6..447b8ef02a 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -17,7 +17,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (310): +CHECK: Warnings without flags (306): CHECK-NEXT: backslash_newline_space CHECK-NEXT: charize_microsoft_ext CHECK-NEXT: ext_anon_param_requires_type_specifier @@ -68,7 +68,6 @@ CHECK-NEXT: ext_invalid_sign_spec CHECK-NEXT: ext_missing_declspec CHECK-NEXT: ext_missing_varargs_arg CHECK-NEXT: ext_missing_whitespace_after_macro_name -CHECK-NEXT: ext_nested_pointer_qualifier_mismatch CHECK-NEXT: ext_new_paren_array_nonconst CHECK-NEXT: ext_nonstandard_escape CHECK-NEXT: ext_offsetof_extended_field_designator @@ -101,7 +100,6 @@ CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard CHECK-NEXT: ext_typecheck_cond_one_void -CHECK-NEXT: ext_typecheck_convert_discards_qualifiers CHECK-NEXT: ext_typecheck_convert_int_pointer CHECK-NEXT: ext_typecheck_convert_pointer_int CHECK-NEXT: ext_typecheck_convert_pointer_void_func @@ -310,8 +308,6 @@ CHECK-NEXT: warn_transparent_union_attribute_floating CHECK-NEXT: warn_transparent_union_attribute_not_definition CHECK-NEXT: warn_transparent_union_attribute_zero_fields CHECK-NEXT: warn_transparent_union_nonpointer -CHECK-NEXT: warn_typecheck_cond_incompatible_pointers -CHECK-NEXT: warn_typecheck_cond_pointer_integer_mismatch CHECK-NEXT: warn_typecheck_function_qualifiers CHECK-NEXT: warn_ucn_escape_too_large CHECK-NEXT: warn_ucn_not_valid_in_c89