On Fri, 18 May 2018, Nathan Sidwell wrote:
On 05/18/2018 08:34 AM, Marc Glisse wrote:
(Cc: said C++ folks)
On Fri, 18 May 2018, Richard Biener wrote:
On Fri, May 18, 2018 at 2:25 PM Marc Glisse <marc.gli...@inria.fr> wrote:
Hello,
this lets alias analysis handle the implicit 'this' parameter in C++
constructors as if it was restrict.
I think the following bizarre code is nevertheless well-formed:
struct selfie {
selfie *me;
selfie (selfie *ptr) : me (ptr) {}
};
selfie bob (&bob);
As long as you do not dereference ptr in the constructor, that shouldn't
contradict 'restrict'. The PR gives this quote from the standard:
"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."
which reads quite close to saying that 'this' is restrict.
--
Marc Glisse