https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93971
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> --- The possibility of storing something other than char in std::string never entered my mind, and I'm pretty sure the container was never meant for that. But whether the standard has all the restrictions in place to rule it out is a different question. If accommodating this use case is a serious concern then getting a clarification from WG21 would seem advisable. Richard's example (slightly modified to avoid const errors): std::string s { "x" }; char *p = &s[0]; *p = s[0]; certainly has to work, just as it or the equivalent version using vector: std::vector<int> v { 7 }; int *p = v.data (); *p = v[0]; works. What I'd like to do is prevent stores to the string (like 's[0] = 0' i.e., those involving the container or pointers that can be traced to it) from being treated as if they might modify any object in the program just because s._M_dataplus._M_p happens to be a char*. (That seems like an implementation detail that should be possible to change to something unrelated like struct std::string::_Foo*.)