brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 9e5400c Raw
39 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3struct __objcFastEnumerationState; 4typedef struct objc_class *Class;5typedef struct objc_object {6 Class isa;7} *id;8    9            10@interface MyList11@end12    13@implementation MyList14- (unsigned int)countByEnumeratingWithState:  (struct __objcFastEnumerationState *)state objects:  (id *)items count:(unsigned int)stackcount15{16        return 0;17}18@end19 20@interface MyList (BasicTest)21- (void)compilerTestAgainst;22@end23 24@implementation MyList (BasicTest)25- (void)compilerTestAgainst {26 27        int i=0;28        for (int * elem in elem) // expected-error {{selector element type 'int *' is not a valid object}} \29				    expected-error {{the type 'int *' is not a pointer to a fast-enumerable object}}30           ++i;31        for (i in elem)  // expected-error {{use of undeclared identifier 'elem'}} \32			    expected-error {{selector element type 'int' is not a valid object}}33           ++i;34        for (id se in i) // expected-error {{the type 'int' is not a pointer to a fast-enumerable object}} 35           ++i;36}37@end38 39