1 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s 2 3 struct S { int a; }; 4 5 extern int charStarFunc(char *); // expected-note{{passing argument to parameter here}} 6 extern int charFunc(char); // expected-note{{passing argument to parameter here}} 7 8 @interface Test 9 +alloc; 10 -(int)charStarMeth:(char *)s; // expected-note{{passing argument to parameter 's' here}} 11 -structMeth:(struct S)s; // expected-note{{passing argument to parameter 's' here}} 12 -structMeth:(struct S)s 13 :(struct S)s2; // expected-note{{passing argument to parameter 's2' here}} 14 @end 15 16 void test() { 17 id obj = [Test alloc]; 18 struct S sInst; 19 20 charStarFunc(1); // expected-warning {{incompatible integer to pointer conversion passing 'int' to parameter of type 'char *'}} 21 charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char [4]' to parameter of type 'char'}} 22 23 [obj charStarMeth:1]; // expected-warning {{incompatible integer to pointer conversion sending 'int'}} 24 [obj structMeth:1]; // expected-error {{sending 'int'}} 25 [obj structMeth:sInst :1]; // expected-error {{sending 'int'}} 26 } 27