From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E84033858D35; Fri, 7 Aug 2020 19:46:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E84033858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596829596; bh=5bIHHsqo9Dq3k5ZJ37n8o8DyS6J4IYbYE1SR+HeBDWo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sCc5HFDEb9zzKfZdVbosZpnMnPdaujgG8Jbx5Mw5rdu0mn0LmQMWsAkP0LFrLFikp fnmqeAsSHyPgji+GOsJ6eCTbKXCrNWD383/z8nMvuyJAB5bOuyayvDo4VrSNzyhjh0 J9RMLEtibt6KGp9Cnsjj04eutmODE7oZrQep1W7o= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/96303] [10/11 Regression] Ambiguous overload for operator!= for std::__debug::bitset compiled with -std=c++20 and -pedantic. Date: Fri, 07 Aug 2020 19:46:36 +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.1.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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: Fri, 07 Aug 2020 19:46:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96303 --- Comment #3 from CVS Commits --- The releases/gcc-10 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:7e26e4fbd4ee618dd991c6bbf3c5403aa90d2192 commit r10-8592-g7e26e4fbd4ee618dd991c6bbf3c5403aa90d2192 Author: Jonathan Wakely Date: Fri Aug 7 20:29:11 2020 +0100 libstdc++: Fix ambiguous comparisons in __gnu_debug::bitset [PR 96303] With -pedantic the debug mode bitset has an ambiguous equality comparison operator, because it tries to compare the non-debug base to the debug object. The base object can be converted to another debug bitset, making the same operator=3D=3D a candidate again. The fix is to do the comparison on both base objects, so the operator for the derived type isn't a candidate. For the inequality operator the same change should be done, but that operator can be removed entirely for C++20 because it can be synthesized by the compiler. I don't think either equality or inequality operators are really needed, because the public _GLIBCXX_STD_C::bitset base class cam always be compared using its own comparison operators. I'm not changing that here though. libstdc++-v3/ChangeLog: PR libstdc++/96303 * include/debug/bitset (bitset::operator=3D=3D): Call _M_base()= on right operand. (bitset::operator!=3D): Likewise, but don't define it at all wh= en default comparisons are supported by the compiler. * testsuite/23_containers/bitset/operations/96303.cc: New test. (cherry picked from commit de1e3b8795e507c3cfa5b62984272628ca62a9bd)=