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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #11)
> I don't think it's valid to use a plain char array as storage for an object
> of another type; the "provides storage" wording in
> http://eel.is/c++draft/intro.object#3 only applies to unsigned char and
> std::byte.

But that implies the problem would still exist for std::vector<std::byte>, and
std::basic_string<unsigned char, my::char_traits<unsigned char>>. But maybe
that's OK, strings of unsigned char are unusual, and a std::vector<std::byte>
might really be used as a buffer of untyped memory.

If we can optimize std::string and std::vector<char> as though their data
pointers don't alias anything else, that would probably be good enough to
please nearly everybody.

Reply via email to