intC::*pci;// expected-error {{'pci' does not point into a class}}
voidA::*pdv;// expected-error {{'pdv' declared as a member pointer to void}}
int&A::*pdr;// expected-error {{'pdr' declared as a pointer to a reference}}
voidf(){
// This requires tentative parsing.
int(A::*pf)(int,int);
// Implicit conversion to bool.
boolb=pdi1;
b=pfi;
// Conversion from null pointer constant.
pf=0;
pf=__null;
// Conversion to member of derived.
intD::*pdid=pdi1;
pdid=pdi2;
// Fail conversion due to ambiguity and virtuality.
intF::*pdif=pdi1;// expected-error {{ambiguous conversion from pointer to member of base class 'struct A' to pointer to member of derived class 'struct F'}} expected-error {{incompatible type}}
intG::*pdig=pdi1;// expected-error {{conversion from pointer to member of class 'struct A' to pointer to member of class 'struct G' via virtual base 'struct D' is not allowed}} expected-error {{incompatible type}}
(void)&((&hm)->*pi);// expected-error {{address expression must be an lvalue or a function designator}}
void(HasMembers::*pf)()=&HasMembers::f;
(hm.*pf)();
(phm->*pf)();
(void)(hm->*pi);// expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct HasMembers'}}
(void)(phm.*pi);// expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'struct HasMembers *'}}
(void)(i.*pi);// expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'int'}}
int*ptr;
(void)(ptr->*pi);// expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'int *'}}
intA::*pai=0;
Dd,*pd=&d;
(void)(d.*pai);
(void)(pd->*pai);
Ff,*ptrf=&f;
(void)(f.*pai);// expected-error {{left hand operand to .* must be a class compatible with the right hand operand, but is 'struct F'}}
(void)(ptrf->*pai);// expected-error {{left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct F *'}}