https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93745
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- What language relies on this? In C, the effective type of declared variables cannot change, and they can only be stored into via the effective type (and char), so in the example d can only be accessed by such types but not via *p. C++ lets programs change the dynamic type of even declared variables but it requires them to invoke the ctor (via placement new). Since that doesn't happen in the example, the store into *p cannot change d in C++ either (if it did, the earlier read from it would be undefined).