// Contributed by Dodji Seketeli // Origin PR c++/37093 template static void foo(void *obj) // { dg-message "note" } { C *p = static_cast(obj); (p->*M)(); } template static void bar(C *c, void (C::*m) ()) { foo((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun|could not convert)" } // { dg-message "candidate" "candidate note" { target *-*-* } 16 } } struct S { void baz () {} }; int main () { S a; bar(&a, &S::baz); }