2008-07-26 04:20:22 +04:00
|
|
|
// RUN: clang -fsyntax-only -verify %s
|
2008-07-26 04:46:50 +04:00
|
|
|
// rdar://5986251
|
2008-07-26 04:20:22 +04:00
|
|
|
|
|
|
|
@protocol SomeProtocol
|
2008-07-26 04:46:50 +04:00
|
|
|
- (void) bar;
|
2008-07-26 04:20:22 +04:00
|
|
|
@end
|
|
|
|
|
|
|
|
void foo(id x) {
|
2008-11-24 02:17:07 +03:00
|
|
|
bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
|
2008-07-26 04:20:22 +04:00
|
|
|
bar((<SomeProtocol>)x); // expected-warning {{protocol qualifiers without 'id' is archaic}}
|
2008-07-26 04:46:50 +04:00
|
|
|
|
|
|
|
[(<SomeProtocol>)x bar]; // expected-warning {{protocol qualifiers without 'id' is archaic}}
|
2008-07-26 04:20:22 +04:00
|
|
|
}
|
|
|
|
|
2008-09-22 14:28:57 +04:00
|
|
|
@protocol MyProtocol
|
|
|
|
- (void)doSomething;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyClass
|
|
|
|
- (void)m1:(id <MyProtocol> const)arg1;
|
|
|
|
|
|
|
|
// FIXME: provide a better diagnostic (no typedef).
|
|
|
|
- (void)m2:(id <MyProtocol> short)arg1; // expected-error {{'short typedef' is invalid}}
|
|
|
|
@end
|