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

Reply via email to