[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 25 22:20:14 GMT 2020


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Related:

const char (&&r)[5] = {"abc"};

This should work, see [dcl.init.list]/3.10, we should create a temporary of the
referenced type and bind the reference to it.


More information about the Gcc-bugs mailing list