From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41CDA3858CDB; Fri, 1 Dec 2023 11:58:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41CDA3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701431909; bh=l04o7pc+8vJAs7gE5kh8SGwWFFLhF6reLGblXcRep20=; h=From:To:Subject:Date:From; b=HZW6g7880tOL4PdLs6srRjgQUbUG/AqtfAoJGf13QqtY+HSO/LdnAWEsnvxQXpAb2 559OGvPOkNQ2p7yQZSAaUpsGbZQ/U+5WDod1bd1INZAZXC8p+jPO4l+n23YU59gSXx gmV7FjN3qr28xJcqroK4BOtXzfeKzZd8oOcABI44= From: "waffl3x at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112810] New: bogus ambiguous overload resolution when taking address of static/xobj member function template introduced by using declaration where candidates have a mismatched deduced return type Date: Fri, 01 Dec 2023 11:58:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: waffl3x at protonmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D112810 Bug ID: 112810 Summary: bogus ambiguous overload resolution when taking address of static/xobj member function template introduced by using declaration where candidates have a mismatched deduced return type Product: gcc Version: 4.9.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: waffl3x at protonmail dot com Target Milestone: --- struct B { static auto f(auto) { return 10; } static int g(auto) { return 10; } }; struct S0 : B { using B::f; using B::g; static auto f(auto) { return 5; } static auto g(auto) { return 5; } }; struct S1 : B { using B::f; using B::g; static int f(auto) { return 5; } static int g(auto) { return 5; } }; void test() { int (*p0)(int) =3D &S0::f; int (*p1)(int) =3D &S0::g; int (*p2)(int) =3D &S1::f; int (*p3)(int) =3D &S1::g; } https://godbolt.org/z/ebcjshfYd This does not present in other cases of overload resolution as far as I've seen. It did not seem to manifest for implicit object member functions at all. The godbolt reproducer uses a slightly different test case to test much older versions of the compiler. I was shocked to find out just how far back this goes. And I was investigating it to make sure my patch wasn't causing it! I can look into fixing it after I finish my patch, if I remember, but that's why I'm posting this report, just in case I don't remember. :^)=