public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94564] New: C++20: Three-way comparison between pointer and nullptr accepted
@ 2020-04-11 19:46 daniel.kruegler at googlemail dot com
  2020-04-13  1:16 ` [Bug c++/94564] " mpolacek at gcc dot gnu.org
  2021-07-28  3:09 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2020-04-11 19:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94564

            Bug ID: 94564
           Summary: C++20: Three-way comparison between pointer and
                    nullptr accepted
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

The following program is accepted when compiling against C++20, but should be
rejected, because the C++20 working draft does not support three-way comparison
between pointer and std::nullptr_t (See [expr.spaceship] p6):

Compiler options:

-Wall -Wextra -pedantic -std=c++20

//-------------------
#include <compare>

template<class T, decltype((((T*) 0) <=> nullptr), true) = false>
void test(T*)
{
}

int main()
{
  test((int*)(nullptr));
}
//-------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/94564] C++20: Three-way comparison between pointer and nullptr accepted
  2020-04-11 19:46 [Bug c++/94564] New: C++20: Three-way comparison between pointer and nullptr accepted daniel.kruegler at googlemail dot com
@ 2020-04-13  1:16 ` mpolacek at gcc dot gnu.org
  2021-07-28  3:09 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-13  1:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94564

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-04-13

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/94564] C++20: Three-way comparison between pointer and nullptr accepted
  2020-04-11 19:46 [Bug c++/94564] New: C++20: Three-way comparison between pointer and nullptr accepted daniel.kruegler at googlemail dot com
  2020-04-13  1:16 ` [Bug c++/94564] " mpolacek at gcc dot gnu.org
@ 2021-07-28  3:09 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-28  3:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94564

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
             Status|NEW                         |RESOLVED
         Depends on|                            |87699
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This was fixed by the patch which fixed bug 87699 expectly.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87699
[Bug 87699] Implement CWG 1512

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-28  3:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-11 19:46 [Bug c++/94564] New: C++20: Three-way comparison between pointer and nullptr accepted daniel.kruegler at googlemail dot com
2020-04-13  1:16 ` [Bug c++/94564] " mpolacek at gcc dot gnu.org
2021-07-28  3:09 ` pinskia at gcc dot gnu.org

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).