[Bug tree-optimization/93971] std::string considered to alias declared objects of incompatible types
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 2 10:45:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93971
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #6)
> I've been thinking of one of two kinds of annotation that wouldn't require
> programs to change and would be sufficient if applied only to the definition
> of the containers: (1) one that would make "std::string::ptr" on par with
> that of any other pointer other than char (i.e., a char that's not allowed
> to be used to access anything but a char object)
but then
std::string s;
char *p = s.c_str();
*p = '0';
s[0]
breaks? ISTR there's ways to get a char * to the std::string storage.
More information about the Gcc-bugs
mailing list