https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113191

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|[10.1/11/12/13/14           |[11/12/13/14 Regression]
                   |Regression] Incorrect       |Incorrect overload
                   |overload resolution when    |resolution when base class
                   |base class function         |function introduced with a
                   |introduced with a using     |using declaration is more
                   |declaration is more         |constrained than a function
                   |constrained than a function |declared in the derived
                   |declared in the derived     |class
                   |class                       |
   Target Milestone|---                         |11.5
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-01-02
      Known to work|                            |10.1.0
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
      Known to fail|                            |10.5.0, 11.4.0, 12.3.0,
                   |                            |13.2.0, 14.0

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
We started rejecting the first testcase since r11-1571-g57b4daf8dc4ed7.

> We do the right thing in more_specialized_fn (which is why the second
case works fine), but that doesn't apply in this case. Perhaps we
should be lifting that work from more_specialized_fn to joust?

Looking at the above commit, joust already takes care to check more_constrained
for non-template functions, and only if their function parameters match
according to cand_parms_match.  But here cand_parms_match returns false due to
different implicit object parameters:

(gdb) frame
#0  cand_parms_match (c2=0x3402cc0, c1=0x3402d70) at gcc/cp/call.cc:12699
12699     if (DECL_FUNCTION_MEMBER_P (fn1)
(gdb) pct parms1

struct B *, void

(gdb) pct parms2

struct S *, void

In contrast more_specialized_fn skips over the implicit object parameter when
comparing two non-static memfns.  Maybe cand_parms_match should follow suit?

Reply via email to