From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 549573836C6F; Tue, 9 Mar 2021 11:17:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 549573836C6F From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/93628] ranges::equal_to doesn't work for types convertible to function pointers Date: Tue, 09 Mar 2021 11:17:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2021 11:17:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93628 --- Comment #1 from Jonathan Wakely --- LWG 3530 should mean we don't have to support such silly types. https://wg21.link/lwg3530 However, we are still required to impose a total order on function pointers, which means ranges::less/greater/less_equal/greater_equal are still (potentially) broken, as for object pointers in PR 78420. We might get away with it if the compiler doesn't do similar optimizations for function point= ers, but we used to say that about object pointers too, and it stopped being tru= e. As noted above, we don't have a way to detect that a relational comparison would call a built-in operator on function pointers. Maybe what we want is a __builtin_less_than(t, u) which is t < u but with a total order.=