blob: cf7eb8386b7700989d4a0a530da431d46176ff70 [file] [log] [blame]
Steve Naroff52664182007-10-16 23:12:48 +00001// RUN: clang -fsyntax-only -verify %s
2
3typedef struct objc_object *id;
4
5struct S { int a; };
6
7extern int charStarFunc(char *);
8extern int charFunc(char);
9
10@interface Test
11+alloc;
12-(int)charStarMeth:(char *)s;
13-structMeth:(struct S)s;
14-structMeth:(struct S)s :(struct S)s2;
15@end
16
17void test() {
18 id obj = [Test alloc];
19 struct S sInst;
20
21 charStarFunc(1); // expected-warning {{incompatible types passing 'int' to function expecting 'char *'}}
22 charFunc("abc"); // expected-warning {{incompatible types passing 'char *' to function expecting 'char'}}
23
24 [obj charStarMeth:1]; // expected-warning {{incompatible types passing 'int' to method expecting 'char *'}}
25 [obj structMeth:1]; // expected-error {{incompatible types passing 'int' to method expecting 'struct S'}}
26 [obj structMeth:sInst :1]; // expected-error {{incompatible types passing 'int' to method expecting 'struct S'}}
27}