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