https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91369
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #3) > (In reply to Jason Merrill from comment #2) > > > should we mark them some way and either allow the first > > > cxx_fold_indirect_ref or the above code to change their type the first > > > time > > > they are stored? > > > > This would work, but wouldn't distinguish between a new-expression and the > > equivalent written by hand. I suppose a flag could make that distinction. > > Wouldn't user written code have REINTERPRET_CAST_P set on the cast and thus > be rejected? > Can user call the replaceable new operator directly in constexpr contexts in > some valid way? Ah, good point. They could call it directly, but couldn't do anything with the memory without a reinterpret_cast.