blob: 144bda4390d5ebaae887eaf39d6459440c2f19a8 [file] [log] [blame]
Fariborz Jahanianadcfab12009-12-16 23:13:33 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3typedef const void * VoidStar;
4
5typedef struct __CFDictionary * CFMDRef;
6
7void RandomFunc(CFMDRef theDict, const void *key, const void *value);
8
9@interface Foo
10- (void)_apply:(void (*)(const void *, const void *, void *))func context:(void *)context;
11- (void)a:(id *)objects b:(id *)keys;
12@end
13
14@implementation Foo
15- (void)_apply:(void (*)(const void *, const void *, void *))func context:(void *)context {
16 id item;
17 id obj;
18 func(item, obj, context);
19}
20
21- (void)a:(id *)objects b:(id *)keys {
22 VoidStar dict;
23 id key;
24 RandomFunc((CFMDRef)dict, key, objects[3]);
25}
26@end
Fariborz Jahanianee9ca692010-03-15 18:36:00 +000027
28@interface I
29- (void) Meth : (I*) Arg;
30@end
31
32void Func (I* arg); // expected-note {{candidate function not viable: no known conversion from 'I const *' to 'I *' for 1st argument}}
33
34void foo(const I *p, I* sel) {
35 [sel Meth : p]; // expected-error {{incompatible type sending 'I const *', expected 'I *'}}
36 Func(p); // expected-error {{no matching function for call to 'Func'}}
37}
38