public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/113191] [11/12/13/14 Regression] Incorrect overload resolution when base class function introduced with a using declaration is more constrained than a function declared in the derived class
Date: Tue, 02 Jan 2024 15:49:12 +0000	[thread overview]
Message-ID: <bug-113191-4-yV6hJCEetx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113191-4@http.gcc.gnu.org/bugzilla/>

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	other threads:[~2024-01-02 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-01 17:00 [Bug c++/113191] New: [10.1/11/12/13/14 " waffl3x at protonmail dot com
2024-01-02 15:49 ` ppalka at gcc dot gnu.org [this message]
2024-01-02 18:24 ` [Bug c++/113191] [11/12/13/14 " waffl3x at protonmail dot com
2024-01-11 22:02 ` cvs-commit at gcc dot gnu.org
2024-01-12 15:14 ` jason at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113191-4-yV6hJCEetx@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).