1 // In a .* expression whose object expression is an rvalue, the program is
2 // ill-formed if the second operand is a pointer to member function with
3 // ref-qualifier &. In a .* expression whose object expression is an
4 // lvalue, the program is ill-formed if the second operand is a pointer to
5 // member function with ref-qualifier &&.
7 // { dg-require-effective-target c++11 }
19 void (A::*p)() & = &A::f;
21 (A().*p)(); // { dg-error "" }
23 p = &A::g; // { dg-error "" }
24 p = &A::h; // { dg-error "" }
26 void (A::*p2)() && = &A::g;
28 (a.*p2)(); // { dg-error "" }
29 p2 = &A::f; // { dg-error "" }
30 p2 = &A::h; // { dg-error "" }
32 void (A::*p3)() = &A::h;
35 p3 = &A::f; // { dg-error "" }
36 p3 = &A::g; // { dg-error "" }
51 void (B<T>::*p)() & = &B<T>::f;
53 (B<T>().*p)(); // { dg-error "" }
55 p = &B<T>::g; // { dg-error "" }
56 p = &B<T>::h; // { dg-error "" }
58 void (B<T>::*p2)() && = &B<T>::g;
60 (a.*p2)(); // { dg-error "" }
61 p2 = &B<T>::f; // { dg-error "" }
62 p2 = &B<T>::h; // { dg-error "" }
64 void (B<T>::*p3)() = &B<T>::h;
67 p3 = &B<T>::f; // { dg-error "" }
68 p3 = &B<T>::g; // { dg-error "" }