From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DD8293858D32; Tue, 2 Jan 2024 15:49:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD8293858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704210553; bh=QmSRHNlk3TMciSqpAVdvzVd8fN8VMJq6RYJfSWLQp8c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vJs4J9bzW9qPUvJvVpS7jdqpo1WTU3trT1T6ZQFFJ4WVWDdtVI61qBZo/0s3M8KUJ QcFcYjx9e1/5twsyaDijJcQq0FZN/K6DDcclx51C3vSP26Ij/isfUeGhYLRpkkQZfx suXwiX/QNYh8Bn8VEepS4/y6i8IC0r89bae2Soaw= From: "ppalka at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed short_desc target_milestone bug_status cf_reconfirmed_on cf_known_to_work cc cf_known_to_fail Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113191 Patrick Palka 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 --- 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_constra= ined 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=3D0x3402cc0, c1=3D0x3402d70) at gcc/cp/call.cc:126= 99 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 wh= en comparing two non-static memfns. Maybe cand_parms_match should follow suit= ?=