2008-01-04 07:38:43 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify -pedantic %s
|
2007-10-17 07:12:48 +08:00
|
|
|
|
|
|
|
struct S { int a; };
|
|
|
|
|
|
|
|
extern int charStarFunc(char *);
|
|
|
|
extern int charFunc(char);
|
|
|
|
|
|
|
|
@interface Test
|
|
|
|
+alloc;
|
|
|
|
-(int)charStarMeth:(char *)s;
|
|
|
|
-structMeth:(struct S)s;
|
|
|
|
-structMeth:(struct S)s :(struct S)s2;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
id obj = [Test alloc];
|
|
|
|
struct S sInst;
|
|
|
|
|
2008-01-05 02:04:52 +08:00
|
|
|
charStarFunc(1); // expected-warning {{incompatible pointer/int conversion passing 'int', expected 'char *'}}
|
|
|
|
charFunc("abc"); // expected-warning {{incompatible pointer/int conversion passing 'char *', expected 'char'}}
|
2007-10-17 07:12:48 +08:00
|
|
|
|
2008-01-04 07:38:43 +08:00
|
|
|
[obj charStarMeth:1]; // expected-warning {{incompatible pointer/int conversion sending 'int'}}
|
|
|
|
[obj structMeth:1]; // expected-error {{incompatible type sending 'int'}}
|
|
|
|
[obj structMeth:sInst :1]; // expected-error {{incompatible type sending 'int'}}
|
2007-10-17 07:12:48 +08:00
|
|
|
}
|