Debian Codegraph @

gcc/testsuite/objc.dg/class-extension-3.m

raw
1 /* Contributed by Nicola Pero <[email protected]>, December 2010. */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-Wno-objc-root-class" } */
4
5 /* This test tests warnings on class extensions. */
6
7 #include <objc/objc.h>
8
9 @interface MyObject
10 {
11 Class isa;
12 int count;
13 }
14 - (int) test; /* { dg-message "previous declaration" } */
15 @property int count; /* { dg-message "originally specified here" } */
16 @end
17
18 @interface MyObject ()
19 - (void) test; /* { dg-error "duplicate declaration of method .-test." } */
20 @end
21
22 @interface MyObject ()
23 @end
24
25 @interface MyObject ()
26 @property int count; /* { dg-error "redeclaration of property .count." } */
27 @end