brintos

brintos / llvm-project-archived public Read only

0
0
Text · 837 B · 7281f55 Raw
40 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface Super @end4 5@interface INTFSTANDALONE : Super6{7  id IVAR;	// expected-note {{previous definition is here}}8}9 10@end11 12@implementation INTFSTANDALONE : Super // expected-warning {{class implementation may not have super class}}13{14  id PRIV_IVAR;15@protected16  id PRTCTD;	17@private18  id IVAR3;19  int IVAR;	// expected-error {{instance variable is already declared}}20@public21  id IVAR4;22}23@end24 25@interface Base @end26 27@implementation Base { 28    int ivar1; 29@public30    int ivar2; 31} 32@end33 34id fn1(INTFSTANDALONE *b) { return b->PRIV_IVAR; } // expected-error {{instance variable 'PRIV_IVAR' is private}}35 36id fn2(INTFSTANDALONE *b) { return b->PRTCTD; }  // expected-error {{instance variable 'PRTCTD' is protected}}37 38id fn4(INTFSTANDALONE *b) { return b->IVAR4; }39 40