summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/class-extension-3.mm
blob: 69e5705396989b4a739eed05f065f61c86664777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */
/* { dg-do compile } */

/* This test tests warnings on class extensions.  */

#include <objc/objc.h>

@interface MyObject
{
  Class isa;
  int count;
}
- (int) test;        /* { dg-message "previous declaration" } */
@property int count; /* { dg-message "originally specified here" } */
@end

@interface MyObject ()
- (void) test; /* { dg-error "duplicate declaration of method .-test." } */
@end

@interface MyObject ()
@end

@interface MyObject ()
@property int count; /* { dg-error "redeclaration of property .count." } */
@end