https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-11-08 Component|middle-end |c++ Ever confirmed|0 |1 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Antony Polukhin from comment #2) > Looks like [class.ctor] paragraph 14 covers this case: > > "During the construction of an object, if the value of the object or any of > its subobjects is accessed through > a glvalue that is not obtained, directly or indirectly, from the > constructor’s this pointer, the value of the > object or subobject thus obtained is unspecified." Yeah, sounds like covering this case. Thus we can make 'this' restrict in constructors (and possibly assignment operators if self-assignment is forbidden). It would be "restrict" in the GCC middle-end sense, not the C specification sense though, barring some extra clarification on "not obtained, directly or indirectly, from the constructor's this pointer". We conservatively propagate what can point to a restrict parameters object. Thus, C++ FE issue.