From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E3C73858428; Tue, 2 Jan 2024 18:24:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E3C73858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704219893; bh=wTIi5j4W6CJ7llPItkVag0u+NlLCqk7ixchq5ckjnFU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PAriRiOmF2bcWkW7iTVHqe43Sl1nlGi2zt0YHN5Sq49qnXKR4tgd1XGHUs9Img1Jp DHIhNSH6PocfeQNnf+c02PhBG8yT/mjwbzKRd81GO+I2TL7OgqkCWQr61CzkFTTD4p /GXj8j9Mw5+dZQkwCH54gkp7B6BhFLe6IZdoKouI= From: "waffl3x at protonmail dot com" 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 18:24:52 +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: waffl3x at protonmail dot com 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: 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 --- Comment #2 from waffl3x --- > 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: Okay yeah I definitely misunderstood something in more_specialized_fn, what it does works but is arguably not the right thing. > (gdb) frame > #0 cand_parms_match (c2=3D0x3402cc0, c1=3D0x3402d70) at gcc/cp/call.cc:1= 2699 > 12699 if (DECL_FUNCTION_MEMBER_P (fn1) > (gdb) pct parms1 >=20 > struct B *, void >=20 > (gdb) pct parms2 >=20 > struct S *, void >=20 > In contrast more_specialized_fn skips over the implicit object parameter > when comparing two non-static memfns. Maybe cand_parms_match should foll= ow > suit? We COULD do that, but it won't solve the problems with implementing the xobj/iobj cases. With that said it probably does make more sense to skip the object parameter when comparing two iobj member functions. Are there ever any situations where both candidates are viable, but have different object parameters? I'm pretty sure that will never be the case, right? I guess I'll have to open another PR for the xobj/iobj cases because I think I agree with your evaluation of this.=