blob: 57ab14f1ff21b2002a8abe2bd9e624b43b574742 [file] [log] [blame]
Chris Lattner01e854d2008-01-03 23:38:43 +00001// RUN: clang -fsyntax-only -verify -pedantic %s
Steve Naroff52664182007-10-16 23:12:48 +00002
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
Chris Lattner01e854d2008-01-03 23:38:43 +000022 [obj charStarMeth:1]; // expected-warning {{incompatible pointer/int conversion sending 'int'}}
23 [obj structMeth:1]; // expected-error {{incompatible type sending 'int'}}
24 [obj structMeth:sInst :1]; // expected-error {{incompatible type sending 'int'}}
Steve Naroff52664182007-10-16 23:12:48 +000025}