https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899
--- Comment #22 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #21) > Note that in the strict C semantic thing __restrict on > this isn't valid as the following is valid C++: > > Foo() __restrict > { > Foo *x = this; > x->a = 1; > this->a = 2; > ... > } > > but for C restrict you'd have two pointers with same provenance here. How is that different from the C void Foo_const(Foo*const restrict t) { Foo *x = t; x->a = 1; t->a = 2; } , which seems valid to me?