[clang] [Clang] Add `noalias` to `this` pointer in C++ constructors (PR #136792)

Guy David via cfe-commits cfe-commits at lists.llvm.org
Tue May 13 00:13:55 PDT 2025


guy-david wrote:

> > @zygoloid Can you explain in your example why `a.n == 2` must be true, when your interpretation (which I understood in the same manner) of the standard's wording does indicate that the object's state is unspecified?
> 
> My reading is that the standard says that the value of `a.n` after `*p = 1;` is unspecified, but after `n = 2;` the value of `a.n` is 2.

I read it as "the value obtained" in the context of the execution of the entire constructor, because no value is really obtained after `*p = 1;`.

https://github.com/llvm/llvm-project/pull/136792


More information about the cfe-commits mailing list