https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #3 from Stephan Hartmann <stha09 at googlemail dot com> --- Scratch comment 2, copied wrong one: template <typename T> struct raw_ptr { T* operator->() const; operator T*() const; template <typename U> explicit operator U*() const; }; struct bar {}; struct foo { typedef void (bar::*GenFunc)(); foo(GenFunc gen_func) { (bar_->*gen_func)(); } raw_ptr<bar> bar_; }; It compiles with clang-12 and clang-13.