public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cjdb.ns at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99701] New: std::nullptr_t can be compared with relational ops Date: Sun, 21 Mar 2021 20:38:23 +0000 [thread overview] Message-ID: <bug-99701-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99701 Bug ID: 99701 Summary: std::nullptr_t can be compared with relational ops Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: cjdb.ns at gmail dot com Target Milestone: --- Created attachment 50443 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50443&action=edit Temp file for provided source The following program is valid in all versions of GCC from 4.7.1 through trunk[1]. Relational operations on std::nullptr_t don't really make sense since there's only one value. ``` auto lt = nullptr < nullptr; auto gt = nullptr > nullptr; auto le = nullptr <= nullptr; auto ge = nullptr >= nullptr; ``` This was apparently addressed by DR583/N3478 (thanks to Richard Smith for providing these). [1]: https://godbolt.org/z/h11183 # Versions * All GCC releases at least as far back as 4.7.1 (where I stopped looking). # System type * Debian (checked GCC 10.2.1) * Compiler Explorer (checked all other reported versions). # Options given to GCC `g++ -save-temps nullptr-relop.cpp -c -std=c++20`
next reply other threads:[~2021-03-21 20:38 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-21 20:38 cjdb.ns at gmail dot com [this message] 2021-03-21 23:34 ` [Bug c++/99701] " redi at gcc dot gnu.org 2021-03-22 13:15 ` mpolacek at gcc dot gnu.org 2021-07-27 15:40 ` mpolacek at gcc dot gnu.org 2024-01-20 17:17 ` pinskia 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-99701-4@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).