blob: 19736cdf50546f7444c83476c1dda8356fdba13d [file] [log] [blame]
Chris Lattnerbce61352008-07-26 00:20:22 +00001// RUN: clang -fsyntax-only -verify %s
Chris Lattner62f5f7f2008-07-26 00:46:50 +00002// rdar://5986251
Chris Lattnerbce61352008-07-26 00:20:22 +00003
4@protocol SomeProtocol
Chris Lattner62f5f7f2008-07-26 00:46:50 +00005- (void) bar;
Chris Lattnerbce61352008-07-26 00:20:22 +00006@end
7
8void foo(id x) {
9 bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-error {{to match this '('}}
10 bar((<SomeProtocol>)x); // expected-warning {{protocol qualifiers without 'id' is archaic}}
Chris Lattner62f5f7f2008-07-26 00:46:50 +000011
12 [(<SomeProtocol>)x bar]; // expected-warning {{protocol qualifiers without 'id' is archaic}}
Chris Lattnerbce61352008-07-26 00:20:22 +000013}
14
Steve Naroff4f9b9f12008-09-22 10:28:57 +000015@protocol MyProtocol
16- (void)doSomething;
17@end
18
19@interface MyClass
20- (void)m1:(id <MyProtocol> const)arg1;
21
22// FIXME: provide a better diagnostic (no typedef).
23- (void)m2:(id <MyProtocol> short)arg1; // expected-error {{'short typedef' is invalid}}
24@end