xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/bad-receiver-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface I
4*f4a2713aSLionel Sambuc- (id) retain;
5*f4a2713aSLionel Sambuc@end
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambucint objc_lookUpClass(const char*);
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambucvoid __raiseExc1() {
10*f4a2713aSLionel Sambuc [objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}}
11*f4a2713aSLionel Sambuc}
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuctypedef const struct __CFString * CFStringRef;
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambucvoid func() {
16*f4a2713aSLionel Sambuc  CFStringRef obj;
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc  [obj self]; // expected-warning {{receiver type 'CFStringRef' (aka 'const struct __CFString *') is not 'id'}} \\
19*f4a2713aSLionel Sambuc                 expected-warning {{method '-self' not found}}
20*f4a2713aSLionel Sambuc}
21