aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/naming-1.mm
blob: 164c8225bb3ec8885729022c8258932625927a43 (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
27
28
29
30
31
/* Testing for detecting duplicate ivars. */
/* { dg-do compile } */

typedef struct S { int i; } NSDictionary;

@interface A 
{
    NSDictionary * _userInfo1; /* { dg-message "previous declaration" } */
    NSDictionary * _userInfo2; /* { dg-message "previous declaration" } */
    NSDictionary * _userInfo3; /* { dg-message "previous declaration" } */
    NSDictionary * _userInfo4; /* { dg-message "previous declaration" } */
}
@end

@interface B : A
{
    NSDictionary * _userInfo1;	/* { dg-error "duplicate instance variable" } */
    NSDictionary * _userInfo2;	/* { dg-error "duplicate instance variable" } */
}
@end

@interface C : A
@end

@interface D : C
{
    NSDictionary * _userInfo3;  /* { dg-error "duplicate instance variable" } */
    NSDictionary * _userInfo4;  /* { dg-error "duplicate instance variable" } */
}
@end