brintos

brintos / llvm-project-archived public Read only

0
0
Text · 745 B · 9b9d58c Raw
33 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3@interface Root @end4 5@interface SuperClass  : Root 6{7  int iSuper;	// expected-note {{previous declaration is here}}8}9@end10 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@end17 18@interface SuperClass () {19   int ivar;	// expected-note {{previous declaration is here}}20}21@end22 23@interface Root () {24  int another_ivar;	// expected-note {{previous declaration is here}}25}26@end27 28@implementation SubClass29-(int) method {30        return self->ivar;  // would be ambiguous if the duplicate ivar were allowed31}32@end33