public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-96303-4-40tDOAsepQ@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-96303-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96303 --- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:de1e3b8795e507c3cfa5b62984272628ca62a9bd commit r11-2611-gde1e3b8795e507c3cfa5b62984272628ca62a9bd Author: Jonathan Wakely <jwakely@redhat.com> 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== 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==): Call _M_base() on right operand. (bitset::operator!=): Likewise, but don't define it at all when default comparisons are supported by the compiler. * testsuite/23_containers/bitset/operations/96303.cc: New test.
next prev parent reply other threads:[~2020-08-07 19:29 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-23 19:01 [Bug libstdc++/96303] New: " matt.lawson at precisionplanting dot com 2020-07-23 19:18 ` [Bug libstdc++/96303] [10/11 Regression] " redi at gcc dot gnu.org 2020-08-07 19:29 ` cvs-commit at gcc dot gnu.org [this message] 2020-08-07 19:46 ` cvs-commit at gcc dot gnu.org 2020-08-07 19:46 ` redi at gcc dot gnu.org 2020-08-27 12:37 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-96303-4-40tDOAsepQ@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).