blob: 9b9d58cc671d745c5d7c611254ee1caf32e2c6c1 [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanianf914b972010-02-23 23:41:11 +00002
3@interface Root @end
4
5@interface SuperClass : Root
6{
7 int iSuper; // expected-note {{previous declaration is here}}
8}
9@end
10
11@interface SubClass : SuperClass {
12 int ivar; // expected-error {{duplicate member 'ivar'}}
13 int another_ivar; // expected-error {{duplicate member 'another_ivar'}}
14 int iSuper; // expected-error {{duplicate member 'iSuper'}}
15}
16@end
17
18@interface SuperClass () {
19 int ivar; // expected-note {{previous declaration is here}}
20}
21@end
22
23@interface Root () {
24 int another_ivar; // expected-note {{previous declaration is here}}
25}
26@end
27
28@implementation SubClass
29-(int) method {
30 return self->ivar; // would be ambiguous if the duplicate ivar were allowed
31}
32@end