From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF8C93864877; Fri, 7 Aug 2020 19:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF8C93864877 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596828557; bh=kCW5rKs06zxR+QanZIYJc5W85jdLR3m1y0zm07sy+3A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uCpGSvshUnurSOTrhDzz2+EbBHHO+6iN4QgPnL+fsnz7kk3O9i7nzOX6rBm1AZK63 Ed7nn12wDbOmqCG211fNAtnubBLzbIuodaIngSGFCoqKj5ybHs56ITBneC5WdMEqnz JBmh0wDTMgw8TZaqIzeGsTkfFnqPM/+Z8MCDDBbU= 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:29:17 +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:29:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96303 --- Comment #2 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:de1e3b8795e507c3cfa5b62984272628ca62a9bd commit r11-2611-gde1e3b8795e507c3cfa5b62984272628ca62a9bd 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.=