1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-pointer-to-int-cast -Wno-objc-root-class -Wno-strict-prototypes %s
9 bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
10 bar((<SomeProtocol>)x); // expected-warning {{protocol has no object type specified; defaults to qualified 'id'}}
12 [(<SomeProtocol>)x bar]; // expected-warning {{protocol has no object type specified; defaults to qualified 'id'}}
20 - (void)m1:(id <MyProtocol> const)arg1;
22 // FIXME: provide a better diagnostic (no typedef).
23 - (void)m2:(id <MyProtocol> short)arg1; // expected-error {{'short type-name' is invalid}}
26 typedef int NotAnObjCObjectType;
28 // GCC doesn't diagnose this.
29 NotAnObjCObjectType <SomeProtocol> *obj; // expected-error {{invalid protocol qualifiers on non-ObjC type}}
31 typedef struct objc_class *Class;
33 Class <SomeProtocol> UnfortunateGCCExtension;
38 - (void)crashWith:(<Broken>)a { // expected-warning {{protocol has no object type specified; defaults to qualified 'id'}}
42 typedef <SomeProtocol> id TwoTypeSpecs; // expected-warning{{no object type specified}}
43 // expected-error@-1{{typedef redefinition with different types ('id<SomeProtocol>' vs 'id')}}
44 // expected-error@-2{{expected ';' after top level declarator}}