From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 873BC3858D1E; Sun, 14 Jan 2024 09:01:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 873BC3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705222908; bh=rAfInjALqKNI7KYenEyBLgonm5xLRH/be0Hce/XrsRE=; h=From:To:Subject:Date:From; b=kjt9hFloGLw2AmcEQZwBzT99I6DlZTry/atoOBjpjRGq0cKAtInUvdF/go2DCaWJw L15s9um60ac7FDblHz6Qc8BHspMS20V6V9tdFJyu4BF+IqvJ/lK90+EItgjkwfCdg5 jg0gCKq76JmQw4R4h3wUtWP2EdY0DPQSt9kl97U0= From: "janschultke at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113386] New: std::pair comparison operators should be transparent, but are not in libstdc++ Date: Sun, 14 Jan 2024 09:01:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: janschultke at googlemail 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=3D113386 Bug ID: 113386 Summary: std::pair comparison operators should be transparent, but are not in libstdc++ Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: janschultke at googlemail dot com Target Milestone: --- ## Code to reproduce #include bool equals(const std::pair& a, const std::pair& b) { return a =3D=3D b; } ## Explanation Clang with -stdlib=3Dlibc++ compiles this, as does MSVC. Bug #90203 was incorrectly closed. std::pair comparison operators should be transparent, see https://eel.is/c++draft/pairs.spec The standard requires the signature: > template > constexpr bool operator=3D=3D(const pair& x, const pair& = y); libstdc++ incorrectly implements this with only two template parameters: > template > inline _GLIBCXX_CONSTEXPR bool > operator=3D=3D(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) > { return __x.first =3D=3D __y.first && __x.second =3D=3D __y.second; }=