aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/objc.dg/naming-6.m
blob: 86e58e087b4f7ce0bc1f103fd40687d4dd5fa43f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Testing for detecting duplicate ivars. */
/* { dg-do compile } */

@interface A 
{
  /* TODO: Have the testsuite check that these messages occur only once!  */
  char x; /* { dg-message "previous declaration" } */
  char x; /* { dg-error "duplicate instance variable" } */
}
@end

/* In some versions of the compiler (eg, 4.6.x), having a subclass
   would generate additional, duplicate errors for the duplicate
   instance variable in the superclass, so adding the following would
   cause the error messages above to be duplicated.  */
@interface B : A
{
  char y;
}
@end