blob: cd84171ee73e77d986f6263eecc5c774dbf6da82 [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
Chris Lattner005ed752008-01-04 18:04:52 +000019 charStarFunc(1); // expected-warning {{incompatible pointer/int conversion passing 'int', expected 'char *'}}
20 charFunc("abc"); // expected-warning {{incompatible pointer/int conversion passing 'char *', expected 'char'}}
Steve Naroff52664182007-10-16 23:12:48 +000021
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}