brintos

brintos / llvm-project-archived public Read only

0
0
Text · 853 B · 09d69ac Raw
41 lines · plain
1// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s2// pr59863 4@interface Test {5  int index;6}7- (int) index;8+ (int) ClassMethod;9@end10 11@implementation Test12- (int) index13{14  return index;15}16+ (int) ClassMethod17{18  return index;	// expected-error {{instance variable 'index' accessed in class method}}19}20@end21 22@interface Test1 {23}24- (int) InstMethod;25+ (int) ClassMethod;26@end27 28@implementation Test129- (int) InstMethod30{31  return index;	// expected-error {{call to undeclared library function 'index'}}	\32                // expected-note {{include the header <strings.h> or explicitly provide a declaration for 'index'}} \33                // expected-error {{incompatible pointer to integer conversion returning}}34}35+ (int) ClassMethod36{37  return index; // expected-error {{incompatible pointer to integer conversion returning}}38}39@end40 41