public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/93971] std::string considered to alias declared objects of incompatible types
[not found] <bug-93971-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-12 5:29 ` jason at gcc dot gnu.org
2023-11-08 13:59 ` redi at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: jason at gcc dot gnu.org @ 2021-12-12 5:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93971
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
CC| |jason at gcc dot gnu.org
Last reconfirmed| |2021-12-12
Ever confirmed|0 |1
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug tree-optimization/93971] std::string considered to alias declared objects of incompatible types
[not found] <bug-93971-4@http.gcc.gnu.org/bugzilla/>
2021-12-12 5:29 ` [Bug tree-optimization/93971] std::string considered to alias declared objects of incompatible types jason at gcc dot gnu.org
@ 2023-11-08 13:59 ` redi at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-08 13:59 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-08 13:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-93971-4@http.gcc.gnu.org/bugzilla/>
2021-12-12 5:29 ` [Bug tree-optimization/93971] std::string considered to alias declared objects of incompatible types jason at gcc dot gnu.org
2023-11-08 13:59 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).