cplusplus / draft

C++ standards drafts
http://www.open-std.org/jtc1/sc22/wg21/
5.68k stars 749 forks source link

[16.4.6.10] missing dereference #6731

Open ilazaric opened 10 months ago

ilazaric commented 10 months ago

https://eel.is/c++draft/res.on.data.races#3

A C++ standard library function shall not directly or indirectly modify objects ([intro.multithread]) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's non-const arguments, including this.

Shouldn't this section specify *this instead of this ? this is never const https://eel.is/c++draft/expr.prim.this#3

const Class obj;
obj.const_mem_fn(); // `this` is `const Class*`
ilazaric commented 10 months ago

Note previous paragraph also mentions this, but it's okay It would also be okay if it were *this due to std::addressof I think

frederick-vs-ja commented 10 months ago

It seems better to say implicit object argument instead of this.

frederick-vs-ja commented 10 months ago

[expr.call]/6 currently says "the this parameter", while this is not the parameter itself but a pointer to it.

frederick-vs-ja commented 2 months ago

LWG4129