[Bug c++/105901] [C++20] Code generation bug. Well-formed Program segfaults.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 8 21:43:21 GMT 2022


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes changing:
        PrintableImpl(T x_) : x{x_} {__builtin_fprintf(stderr,"%s\n",
__PRETTY_FUNCTION__);}

To:
        PrintableImpl(T x_) : x(x_) {__builtin_fprintf(stderr,"%s\n",
__PRETTY_FUNCTION__);}


Works.

That is in the original code:
        PrintableImpl(T x) : x{std::move(x)} {}

to:
        PrintableImpl(T x) : x(std::move(x)) {}


So yes this is a dup of bug 85577.

This is https://wg21.link/cwg2137 .

*** This bug has been marked as a duplicate of bug 85577 ***


More information about the Gcc-bugs mailing list