23 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: cp %s %t3// RUN: not %clang_cc1 -fixit -x c %t4// RUN: %clang_cc1 -fsyntax-only -pedantic -x c %t5 6void ip(int *aPtr) {} // expected-note{{passing argument to parameter 'aPtr' here}}7void i(int a) {} // expected-note{{passing argument to parameter 'a' here}}8void ii(int a) {} // expected-note{{passing argument to parameter 'a' here}}9void fp(float *aPtr) {} // expected-note{{passing argument to parameter 'aPtr' here}}10void f(float a) {} // expected-note{{passing argument to parameter 'a' here}}11 12void f2(int *aPtr, int a, float *bPtr, char c) {13 float fl = 0;14 ip(a); // expected-error{{incompatible integer to pointer conversion passing 'int' to parameter of type 'int *'; take the address with &}}15 i(aPtr); // expected-error{{incompatible pointer to integer conversion passing 'int *' to parameter of type 'int'; dereference with *}}16 ii(&a); // expected-error{{incompatible pointer to integer conversion passing 'int *' to parameter of type 'int'; remove &}}17 fp(*bPtr); // expected-error{{passing 'float' to parameter of incompatible type 'float *'; remove *}}18 f(bPtr); // expected-error{{passing 'float *' to parameter of incompatible type 'float'; dereference with *}}19 a = aPtr; // expected-error{{incompatible pointer to integer conversion assigning to 'int' from 'int *'; dereference with *}}20 fl = bPtr + a; // expected-error{{assigning to 'float' from incompatible type 'float *'; dereference with *}}21 bPtr = bPtr[a]; // expected-error{{assigning to 'float *' from incompatible type 'float'; take the address with &}}22}23