1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
6 /* Test that if you have a property declared in a class, with
7 getters/setters in the superclass, there are no warnings. */
17 - (void)setCount: (int)number;
19 - (void)setCount2: (int)number;
23 @implementation MyRootClass
28 - (void) setCount: (int)number
36 - (void) setCount2: (int)number
48 /* Try with a subclass. */
49 @interface MyClass : MyRootClass
53 @implementation MyClass
54 @end /* No warnings. */
58 /* Try with a category. */
59 @interface MyRootClass (count)
63 @implementation MyRootClass (count)
64 @end /* No warnings. */
68 /* Try with a category of a subclass. */
69 @interface MyClass2 : MyClass
72 @implementation MyClass2
75 @interface MyClass2 (count2)
79 @implementation MyClass2 (count2)
80 @end /* No warnings. */
84 /* Now, try with a category of a subclass, but with a missing setter,
85 which should generate a warning. */
86 @interface MyClass3 : MyClass
89 @implementation MyClass3
92 @interface MyClass3 (count3)
96 @implementation MyClass3 (count3)
97 @end /* { dg-warning "incomplete implementation" } */
98 /* { dg-warning "method definition for .-setCount3:. not found" "" { target *-*-* } 97 } */