From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C410385840F; Thu, 30 May 2024 10:09:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C410385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717063792; bh=Puj4r3vwDOekWzaHrQm2AUTekVDjAenXmLTa09NkuWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WyCLZI03aUXBYP+hRu3d6uS/tb6u3k9dNKYsqD7BhdXhmvTUgX375T4uUoMbAF7Rd B2kQIUKVEgtUE22h+KYUulA1pQkyueM8EX+BFjo+3Tas9HWGXUsdUsAXGzgAbss4cU zZ0iSLUw2XHh2IdH+lPzQdS6eI/rEqoLaw2xNvrk= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/115285] [12/13/14/15 Regression] std::unordered_set can have duplicate value Date: Thu, 30 May 2024 10:09:51 +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: 15.0 X-Bugzilla-Keywords: needs-bisection 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: 12.4 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=3D115285 --- Comment #8 from Jonathan Wakely --- Or r12-6272-ge3ef832a9e8d6a I think the testcase is invalid. The unordered_set uses std::equal_to to decide if a key already exists in the containe= r, and that just uses operator=3D=3D which is not defined for TrimmedStr, so i= t uses the equality comparison for std::string. When that is used to compare TrimmedStr("foo") =3D=3D "foo "s it's equivalent to "foo"s =3D=3D "foo "s w= hich is obviously false.=