cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[expr.prim.lambda.capture] p13 lacks the wording to specify which entity `this` refers to when is captured by reference #441

Open xmh0511 opened 9 months ago

xmh0511 commented 9 months ago

Full name of submitter (unless configured in github; will be published with the issue): Jim X

[expr.prim.lambda.capture] p13

An id-expression within the compound-statement of a lambda-expression that is an odr-use of a reference captured by reference refers to the entity to which the captured reference is bound and not to the captured reference.

This rule only specifies the case to which entity the id-expression denoting a reference refers. However, it should tell the complete story about the variable that is an object and this, that is, which entity the expression that denotes the object or *this refers to within the lambda-expression.