public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/104099] New: [12 Regression] basic_string(nullptr) constructor should not be present before C++23
@ 2022-01-18 15:59 redi at gcc dot gnu.org
  2022-01-18 15:59 ` [Bug libstdc++/104099] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-18 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104099
           Summary: [12 Regression] basic_string(nullptr) constructor
                    should not be present before C++23
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <string>

struct S
{
  operator const char*() const { return ""; }
  operator std::nullptr_t() const { return {}; }
};

std::string s{ S{} };

This is valid in C++20 and earlier, but ill-formed in C++23. GCC rejects this
in C++20, because I made P2166R1 apply to C++11 and later (r12-4140).

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

* [Bug libstdc++/104099] [12 Regression] basic_string(nullptr) constructor should not be present before C++23
  2022-01-18 15:59 [Bug libstdc++/104099] New: [12 Regression] basic_string(nullptr) constructor should not be present before C++23 redi at gcc dot gnu.org
@ 2022-01-18 15:59 ` redi at gcc dot gnu.org
  2022-01-18 20:43 ` cvs-commit at gcc dot gnu.org
  2022-01-18 20:44 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-18 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-18
   Target Milestone|---                         |12.0
           Priority|P3                          |P1
      Known to fail|                            |12.0
      Known to work|                            |11.2.0
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug libstdc++/104099] [12 Regression] basic_string(nullptr) constructor should not be present before C++23
  2022-01-18 15:59 [Bug libstdc++/104099] New: [12 Regression] basic_string(nullptr) constructor should not be present before C++23 redi at gcc dot gnu.org
  2022-01-18 15:59 ` [Bug libstdc++/104099] " redi at gcc dot gnu.org
@ 2022-01-18 20:43 ` cvs-commit at gcc dot gnu.org
  2022-01-18 20:44 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 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:fe3ed885cda5ab920d361b694ee539242052022f

commit r12-6698-gfe3ed885cda5ab920d361b694ee539242052022f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jan 18 16:26:45 2022 +0000

    libstdc++: Limit new basic_string(nullptr_t) constructor to C++23
[PR104099]

    The new deleted constructors added by P2166R1 are a breaking change,
    making previously valid code ill-formed in C++23. As a result, they
    should only be defined for C++23 and not for C++11 and up.

    libstdc++-v3/ChangeLog:

            PR libstdc++/104099
            * include/bits/basic_string.h (basic_string(nullptr_t)): Only
            define for C++23.
            (operator=(nullptr_t)): Likewise.
            * include/bits/cow_string.h: Likewise.
            * include/std/string_view (basic_string_view(nullptr_t)):
            Likewise.
            * testsuite/21_strings/basic_string/cons/char/nullptr.cc: Adjust
            expected error. Add examples that become ill-formed in C++23.
            * testsuite/21_strings/basic_string_view/cons/char/nonnull.cc:
            Adjust expected errors.
            * testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc:
            Likewise.

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

* [Bug libstdc++/104099] [12 Regression] basic_string(nullptr) constructor should not be present before C++23
  2022-01-18 15:59 [Bug libstdc++/104099] New: [12 Regression] basic_string(nullptr) constructor should not be present before C++23 redi at gcc dot gnu.org
  2022-01-18 15:59 ` [Bug libstdc++/104099] " redi at gcc dot gnu.org
  2022-01-18 20:43 ` cvs-commit at gcc dot gnu.org
@ 2022-01-18 20:44 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-18 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2022-01-18 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 15:59 [Bug libstdc++/104099] New: [12 Regression] basic_string(nullptr) constructor should not be present before C++23 redi at gcc dot gnu.org
2022-01-18 15:59 ` [Bug libstdc++/104099] " redi at gcc dot gnu.org
2022-01-18 20:43 ` cvs-commit at gcc dot gnu.org
2022-01-18 20:44 ` redi 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).