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