[Bug c++/94264] Array-to-pointer conversion not performed on array prvalues
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 28 18:05:49 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94264
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
Depends on| |53220
Status|NEW |ASSIGNED
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
This is due to my PR53220 change to discourage use of compound-literals in ways
that produce a dangling pointer when the C++ compiler treats them as prvalues,
unlike C where they have variable lifetime.
I think the change was always wrong, but wasn't really a problem until we added
array prvalues in C++17.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53220
[Bug 53220] [4.7/4.8 Regression] g++ mis-compiles compound literals
More information about the Gcc-bugs
mailing list