// Ensure that we allow C-specific type conversions in C
voidfn_type_conversions(){
voidfoo(void*c)__attribute__((overloadable));
voidfoo(char*c)__attribute__((overloadable));
void(*ptr1)(void*)=&foo;
void(*ptr2)(char*)=&foo;
void(*ambiguous)(int*)=&foo;// expected-error{{initializing 'void (*)(int *)' with an expression of incompatible type '<overloaded function type>'}} expected-note@105{{candidate function}} expected-note@106{{candidate function}}
void*vp_ambiguous=&foo;// expected-error{{initializing 'void *' with an expression of incompatible type '<overloaded function type>'}} expected-note@105{{candidate function}} expected-note@106{{candidate function}}
void(*specific1)(int*)=(void(*)(void*))&foo;// expected-warning{{incompatible pointer types initializing 'void (*)(int *)' with an expression of type 'void (*)(void *)'}}
voiddisabled(char*c)__attribute__((overloadable,enable_if(1,"The function name lies.")));
// To be clear, these should all point to the last overload of 'disabled'
void(*dptr1)(char*c)=&disabled;
void(*dptr2)(void*c)=&disabled;// expected-warning{{incompatible pointer types initializing 'void (*)(void *)' with an expression of type '<overloaded function type>'}} expected-note@115{{candidate function made ineligible by enable_if}} expected-note@116{{candidate function made ineligible by enable_if}} expected-note@117{{candidate function has type mismatch at 1st parameter (expected 'void *' but has 'char *')}}
void(*dptr3)(int*c)=&disabled;// expected-warning{{incompatible pointer types initializing 'void (*)(int *)' with an expression of type '<overloaded function type>'}} expected-note@115{{candidate function made ineligible by enable_if}} expected-note@116{{candidate function made ineligible by enable_if}} expected-note@117{{candidate function has type mismatch at 1st parameter (expected 'int *' but has 'char *')}}