Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
[clang.git] / test / SemaObjC / duplicate-ivar-in-class-extension.m
blob0507b352f602f7e82560a2cb74b663d0fd9116b6
1 // RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -verify %s
3 @interface Root @end
5 @interface SuperClass  : Root 
7   int iSuper;   // expected-note {{previous declaration is here}}
9 @end
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'}}
16 @end
18 @interface SuperClass () {
19    int ivar;    // expected-note {{previous declaration is here}}
21 @end
23 @interface Root () {
24   int another_ivar;     // expected-note {{previous declaration is here}}
26 @end
28 @implementation SubClass
29 -(int) method {
30         return self->ivar;  // would be ambiguous if the duplicate ivar were allowed
32 @end