void(*ptr1)(int,int)=&fun;// expected-error {{cannot initialize a variable of type 'void (*)(int, int)' with an rvalue of type 'void (*)(int)': different number of parameters (2 vs 1)}}
void(*ptr2)(int,int);
ptr2=&fun;// expected-error {{assigning to 'void (*)(int, int)' from incompatible type 'void (*)(int)': different number of parameters (2 vs 1)}}
void(*ptr1)(double)=&fun;// expected-error {{cannot initialize a variable of type 'void (*)(double)' with an rvalue of type 'void (*)(int)': type mismatch at 1st parameter ('double' vs 'int')}}
ptr2=&fun;// expected-error {{assigning to 'void (*)(double)' from incompatible type 'void (*)(int)': type mismatch at 1st parameter ('double' vs 'int')}}
}
voidreturn_type_test(){
int(*ptr1)(int)=&fun;// expected-error {{cannot initialize a variable of type 'int (*)(int)' with an rvalue of type 'void (*)(int)': different return type ('int' vs 'void')}}
int(*ptr2)(int);
ptr2=&fun;// expected-error {{assigning to 'int (*)(int)' from incompatible type 'void (*)(int)': different return type ('int' vs 'void')}}
}
intfoo(doublex,doubley){return0;}// expected-note {{candidate function has different number of parameters (expected 1 but has 2)}}
intfoo(intx,inty){return0;}// expected-note {{candidate function has different number of parameters (expected 1 but has 2)}}
intfoo(doublex){return0;}// expected-note {{candidate function has type mismatch at 1st parameter (expected 'int' but has 'double')}}
doublefoo(floatx,floaty){return0;}// expected-note {{candidate function has different number of parameters (expected 1 but has 2)}}
doublefoo(intx,floaty){return0;}// expected-note {{candidate function has different number of parameters (expected 1 but has 2)}}
doublefoo(floatx){return0;}// expected-note {{candidate function has type mismatch at 1st parameter (expected 'int' but has 'float')}}
doublefoo(intx){return0;}// expected-note {{candidate function has different return type ('int' expected but has 'double')}}
int(*ptr)(int)=&foo;// expected-error {{address of overloaded function 'foo' does not match required type 'int (int)'}}
X=&Qualifiers::C;// expected-error-re {{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} const': different qualifiers (none vs const)}}
X=&Qualifiers::V;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} volatile': different qualifiers (none vs volatile)}}
X=&Qualifiers::R;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} __restrict': different qualifiers (none vs restrict)}}
X=&Qualifiers::CV;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} const volatile': different qualifiers (none vs const and volatile)}}
X=&Qualifiers::CR;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} const __restrict': different qualifiers (none vs const and restrict)}}
X=&Qualifiers::VR;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} volatile __restrict': different qualifiers (none vs volatile and restrict)}}
X=&Qualifiers::CVR;// expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' from incompatible type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}} const volatile __restrict': different qualifiers (none vs const, volatile, and restrict)}}
void(Qualifiers::*X)()=&Dummy::N;// expected-error-re{{cannot initialize a variable of type 'void (test1::Qualifiers::*)(){{( __attribute__\(\(thiscall\)\))?}}' with an rvalue of type 'void (test1::Dummy::*)(){{( __attribute__\(\(thiscall\)\))?}}': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}