public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a Date: Tue, 26 May 2020 21:21:17 +0000 [thread overview] Message-ID: <bug-95242-4-CdtqgfWMWe@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95242-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org CC| |jason at gcc dot gnu.org, | |jwakely.gcc at gmail dot com Last reconfirmed| |2020-05-26 --- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> --- Yes, in C++20 mode the < comparison uses operator<=> to produce a std::strong_ordering, and then compares that to literal 0 to produce a boolean value. The operator< has an rhs type of 'std::__cmp_cat::__unspec', which has a single constructor taking a pointer to itself, which is designed to only accept null pointer constants, but this causes problems with this warning.
next prev parent reply other threads:[~2020-05-26 21:21 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-20 18:24 [Bug c++/95242] New: [10 " gcc at mattwhitlock dot name 2020-05-22 6:08 ` [Bug c++/95242] [10/11 " rguenth at gcc dot gnu.org 2020-05-26 21:21 ` jason at gcc dot gnu.org [this message] 2020-05-26 23:13 ` redi at gcc dot gnu.org 2020-05-27 5:21 ` daniel.kruegler at googlemail dot com 2020-05-27 6:59 ` redi at gcc dot gnu.org 2020-05-27 8:07 ` daniel.kruegler at googlemail dot com 2020-05-27 8:20 ` redi at gcc dot gnu.org 2020-05-27 14:15 ` jason 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-95242-4-CdtqgfWMWe@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).