From 124066c5cb73cf2e47d542371df125ff885a1c29 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 May 2012 05:56:02 +0000 Subject: [PATCH] Place several uncovered warnings under warning flags, and tweak diagnostic output including the term "gc" (in lowercase). llvm-svn: 155892 --- clang/include/clang/Basic/DiagnosticGroups.td | 2 ++ clang/include/clang/Basic/DiagnosticSemaKinds.td | 12 ++++++++---- clang/test/Misc/warning-flags.c | 6 +----- clang/test/SemaObjC/property-10.m | 2 +- clang/test/SemaObjC/property.m | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 3f6c5c0c0d29..234412af9262 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -96,6 +96,7 @@ def CXX11Compat : DiagGroup<"c++11-compat", def : DiagGroup<"c++0x-compat", [CXX11Compat]>; def : DiagGroup<"effc++">; +def DivZero : DiagGroup<"division-by-zero">; def ExitTimeDestructors : DiagGroup<"exit-time-destructors">; def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">; def FourByteMultiChar : DiagGroup<"four-char-constants">; @@ -145,6 +146,7 @@ def : DiagGroup<"overflow">; def OverlengthStrings : DiagGroup<"overlength-strings">; def OverloadedVirtual : DiagGroup<"overloaded-virtual">; def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; +def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">; def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 141bd4cc443a..ee883ae3b2ed 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -581,13 +581,15 @@ def err_objc_property_requires_object : Error< "property with '%0' attribute must be of object type">; def warn_objc_property_no_assignment_attribute : Warning< "no 'assign', 'retain', or 'copy' attribute is specified - " - "'assign' is assumed">; + "'assign' is assumed">, + InGroup; def warn_objc_isa_use : Warning< "direct access to objective-c's isa is deprecated " "in favor of object_setClass() and object_getClass()">, InGroup>; def warn_objc_property_default_assign_on_object : Warning< - "default property attribute 'assign' not appropriate for non-gc object">; + "default property attribute 'assign' not appropriate for non-GC object">, + InGroup; def warn_property_attr_mismatch : Warning< "property attribute in continuation class does not match the primary class">; def warn_objc_property_copy_missing_on_block : Warning< @@ -3549,8 +3551,10 @@ def warn_floatingpoint_eq : Warning< "comparing floating point with == or != is unsafe">, InGroup>, DefaultIgnore; -def warn_division_by_zero : Warning<"division by zero is undefined">; -def warn_remainder_by_zero : Warning<"remainder by zero is undefined">; +def warn_division_by_zero : Warning<"division by zero is undefined">, + InGroup; +def warn_remainder_by_zero : Warning<"remainder by zero is undefined">, + InGroup; def warn_shift_negative : Warning<"shift count is negative">, InGroup>; def warn_shift_gt_typewidth : Warning<"shift count >= width of type">, diff --git a/clang/test/Misc/warning-flags.c b/clang/test/Misc/warning-flags.c index c8f7f1a0095f..b8be61533975 100644 --- a/clang/test/Misc/warning-flags.c +++ b/clang/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 (252): +CHECK: Warnings without flags (248): CHECK-NEXT: ext_anonymous_struct_union_qualified CHECK-NEXT: ext_binary_literal CHECK-NEXT: ext_cast_fn_obj @@ -134,7 +134,6 @@ CHECK-NEXT: warn_conv_to_base_not_used CHECK-NEXT: warn_conv_to_self_not_used CHECK-NEXT: warn_conv_to_void_not_used CHECK-NEXT: warn_delete_array_type -CHECK-NEXT: warn_division_by_zero CHECK-NEXT: warn_double_const_requires_fp64 CHECK-NEXT: warn_drv_assuming_mfloat_abi_is CHECK-NEXT: warn_drv_clang_unsupported @@ -192,8 +191,6 @@ CHECK-NEXT: warn_ns_attribute_wrong_parameter_type CHECK-NEXT: warn_ns_attribute_wrong_return_type CHECK-NEXT: warn_objc_object_attribute_wrong_type CHECK-NEXT: warn_objc_property_copy_missing_on_block -CHECK-NEXT: warn_objc_property_default_assign_on_object -CHECK-NEXT: warn_objc_property_no_assignment_attribute CHECK-NEXT: warn_objc_protocol_qualifier_missing_id CHECK-NEXT: warn_octal_escape_too_large CHECK-NEXT: warn_odr_tag_type_inconsistent @@ -243,7 +240,6 @@ CHECK-NEXT: warn_redeclaration_without_attribute_prev_attribute_ignored CHECK-NEXT: warn_register_objc_catch_parm CHECK-NEXT: warn_related_result_type_compatibility_class CHECK-NEXT: warn_related_result_type_compatibility_protocol -CHECK-NEXT: warn_remainder_by_zero CHECK-NEXT: warn_root_inst_method_not_found CHECK-NEXT: warn_second_parameter_of_va_start_not_last_named_argument CHECK-NEXT: warn_second_parameter_to_va_arg_never_compatible diff --git a/clang/test/SemaObjC/property-10.m b/clang/test/SemaObjC/property-10.m index 51eb39c9e7cd..8cb8ec63a916 100644 --- a/clang/test/SemaObjC/property-10.m +++ b/clang/test/SemaObjC/property-10.m @@ -24,7 +24,7 @@ @property(unsafe_unretained, copy, retain) id p4_3; // expected-error {{property attributes 'unsafe_unretained' and 'copy' are mutually exclusive}}, expected-error {{property attributes 'unsafe_unretained' and 'retain' are mutually exclusive}} @property(unsafe_unretained, copy, strong) id s4_3; // expected-error {{property attributes 'unsafe_unretained' and 'copy' are mutually exclusive}}, expected-error {{property attributes 'unsafe_unretained' and 'strong' are mutually exclusive}} -@property id p4; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for non-gc object}} +@property id p4; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} @property(nonatomic,copy) int (^includeMailboxCondition)(); @property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}} diff --git a/clang/test/SemaObjC/property.m b/clang/test/SemaObjC/property.m index a9487412c19d..fae628664ca5 100644 --- a/clang/test/SemaObjC/property.m +++ b/clang/test/SemaObjC/property.m @@ -6,7 +6,7 @@ int name; } @property int d1; -@property id prop_id; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for non-gc object}} +@property id prop_id; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} @property int name; @end