Do not warn with -Wuninitialized when the member is used in a sizeof or address-of...
[clang.git] / test / SemaObjC / protocol-archane.m
blob138c43d1a83a894b748dda8be187c839c50206b1
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // rdar://5986251
4 @protocol SomeProtocol
5 - (void) bar;
6 @end
8 void bar();
9 void foo(id x) {
10   bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
11   bar((<SomeProtocol>)x);      // expected-warning {{protocol qualifiers without 'id' is archaic}}
13   [(<SomeProtocol>)x bar];      // expected-warning {{protocol qualifiers without 'id' is archaic}}
16 @protocol MyProtocol
17 - (void)doSomething;
18 @end
20 @interface MyClass
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}}
25 @end
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;