From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5738E3858C83; Sun, 30 Oct 2022 19:13:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5738E3858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667157199; bh=XXwFcnEj0sJguxk7rlnbUFEGA5NmucFMK2WdepjPJBg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Qo0/Y/mn+EYvDpjbtk49vDYgZczKTLA23O2xycJ2RyT07o1G/bHSk/7X4cEMCLxNc GnDSojuRYjnYvF18YyTn+zZbgaHyFRDqVqPDs0gfLS+GFGjPvLvPfzjl6ikut5TGsq Mjl3YL1oeA/oXIm31SHfthXIgyGdHUBbEfXswvos= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107461] GCC rejects program with ambiguity error Date: Sun, 30 Oct 2022 19:13:18 +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: 13.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed 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=3D107461 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2022-10-30 Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski --- Confirmed. reduced testcase: template constexpr const T min(const T t0, const T t1) { return 0= ; } template struct Matrix{ template friend Matrix operator+(Matrix const& lhs, Matrix const& rhs); }; template Matrix operator+(Matrix const& lhs, Matrix const& rhs); void f() { Matrix<1> a; a+a; } ---- CUT ---- Note the min function inside the return type is important and is looking li= ke is what is causing issues to not match the two decls to be the same. Having min as a non-template function allows it to be matched.=