diff options
-rw-r--r-- | gcc/cp/call.cc | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/overload/builtin6.C | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index ec6c5d5..dfe370d 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -2821,7 +2821,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, tree c1 = TREE_TYPE (type1); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); - if (MAYBE_CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1) + if (CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; diff --git a/gcc/testsuite/g++.dg/overload/builtin6.C b/gcc/testsuite/g++.dg/overload/builtin6.C new file mode 100644 index 0000000..de192be --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/builtin6.C @@ -0,0 +1,14 @@ +// PR c++/103455 + +struct A { }; + +struct B { + operator A*() const; + template<class T> operator T*() const; +}; + +typedef void (A::*F)(); + +void f(B b, F pmf) { + (b->*pmf)(); +} |