brintos

brintos / llvm-project-archived public Read only

0
0
Text · 942 B · e28b74f Raw
39 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3typedef struct objc_class *Class;4struct __objcFastEnumerationState; 5typedef struct objc_object {6 Class isa;7} *id;8    9@protocol P @end10 11@interface MyList12@end13    14@implementation MyList15- (unsigned int)countByEnumeratingWithState:  (struct __objcFastEnumerationState *)state objects:  (id *)items count:(unsigned int)stackcount16{17        return 0;18}19@end20 21@interface MyList (BasicTest)22- (void)compilerTestAgainst;23@end24 25@implementation MyList (BasicTest)26- (void)compilerTestAgainst {27    static i;// expected-error {{type specifier missing, defaults to 'int'}}28        for (id el, elem in self)  // expected-error {{only one element declaration is allowed}}29           ++i;30        for (id el in self) 31           ++i;32	MyList<P> ***p;33        for (p in self)  // expected-error {{selector element type 'MyList<P> ***' is not a valid object}}34           ++i;35 36}37@end38 39