https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103783
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:3e95a974c39e922d19bf7ac1246730c516ae01f2 commit r12-6424-g3e95a974c39e922d19bf7ac1246730c516ae01f2 Author: Patrick Palka <ppa...@redhat.com> Date: Mon Jan 10 14:57:51 2022 -0500 c++: "more constrained" vs staticness of memfn [PR103783] Here we're rejecting the calls to g1 and g2 as ambiguous even though one overload is more constrained than the other (and they're otherwise tied), because the implicit 'this' parameter of the non-static overload causes cand_parms_match to think the function parameter lists aren't equivalent. This patch fixes this by making cand_parms_match skip over 'this' appropriately. Note that this bug only affects partial ordering of non-template member functions because for member function templates more_specialized_fn seems to already skip over 'this' appropriately. PR c++/103783 gcc/cp/ChangeLog: * call.c (cand_parms_match): Skip over 'this' when given one static and one non-static member function. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-memfun2.C: New test.