2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -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:22:42 +08:00
|
|
|
charStarFunc(1); // expected-warning {{incompatible integer to pointer conversion passing 'int', expected 'char *'}}
|
2008-02-11 08:02:17 +08:00
|
|
|
charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char [4]', expected 'char'}}
|
2007-10-17 07:12:48 +08:00
|
|
|
|
2008-01-05 02:22:42 +08:00
|
|
|
[obj charStarMeth:1]; // expected-warning {{incompatible integer to pointer conversion sending 'int'}}
|
2008-01-04 07:38:43 +08:00
|
|
|
[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
|
|
|
}
|