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; };
|
|
|
|
|
2010-04-22 08:20:18 +08:00
|
|
|
extern int charStarFunc(char *); // expected-note{{passing argument to parameter here}}
|
|
|
|
extern int charFunc(char); // expected-note{{passing argument to parameter here}}
|
2007-10-17 07:12:48 +08:00
|
|
|
|
|
|
|
@interface Test
|
|
|
|
+alloc;
|
2010-04-22 08:20:18 +08:00
|
|
|
-(int)charStarMeth:(char *)s; // expected-note{{passing argument to parameter 's' here}}
|
|
|
|
-structMeth:(struct S)s; // expected-note{{passing argument to parameter 's' here}}
|
|
|
|
-structMeth:(struct S)s
|
|
|
|
:(struct S)s2; // expected-note{{passing argument to parameter 's2' here}}
|
2007-10-17 07:12:48 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
id obj = [Test alloc];
|
|
|
|
struct S sInst;
|
|
|
|
|
2010-04-09 08:35:39 +08:00
|
|
|
charStarFunc(1); // expected-warning {{incompatible integer to pointer conversion passing 'int' to parameter of type 'char *'}}
|
|
|
|
charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char [4]' to parameter of type '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'}}
|
2010-04-09 08:35:39 +08:00
|
|
|
[obj structMeth:1]; // expected-error {{sending 'int'}}
|
|
|
|
[obj structMeth:sInst :1]; // expected-error {{sending 'int'}}
|
2007-10-17 07:12:48 +08:00
|
|
|
}
|