freebsd-skq/test/SemaObjC/bad-receiver-1.m

22 lines
551 B
Mathematica
Raw Normal View History

2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -fsyntax-only -verify %s
2009-06-02 17:58:47 +00:00
@interface I
- (id) retain;
@end
2010-01-15 15:39:40 +00:00
int objc_lookUpClass(const char*);
2009-06-02 17:58:47 +00:00
void __raiseExc1() {
[objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}} \
expected-warning {{method '-retain' not found}}
}
typedef const struct __CFString * CFStringRef;
void func() {
CFStringRef obj;
[obj self]; // expected-warning {{receiver type 'CFStringRef' (aka 'const struct __CFString *') is not 'id'}} \\
2009-06-02 17:58:47 +00:00
expected-warning {{method '-self' not found}}
}