1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// PR c++/33844 // { dg-do compile } struct A {}; template<int> void foo(void (A::* f)()) { A a; &(a.*f); // { dg-error "invalid use of\[^\n\]*\\.\\*\[^\n\]*to form|qualified-id is required" } } template<int> void bar(void (A::* f)()) { A *p; &(p->*f); // { dg-error "invalid use of\[^\n\]*->\\*\[^\n\]*to form|qualified-id is required" } }