[class.mfct.non-static] p3 class member access transformation in the context where "this" is not permitted
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[class.mfct.non-static] p3
When an id-expression ([expr.prim.id]) that is not part of a class member access syntax ([expr.ref]) and not used to form a pointer to member ([expr.unary.op]) is used where the current class is X ([expr.prim.this]), if name lookup ([basic.lookup]) resolves the name in the id-expression to a non-static non-type member of some class C, and if either the id-expression is potentially evaluated or C is X or a base class of X, the id-expression is transformed into a class member access expression ([expr.ref]) using (*this) as the postfix-expression to the left of the . operator.
Consider this example
struct B{
int d;
void show(decltype(d)); // #1
};
the name d in #1 resolves to the non-static data member of B, the current class is also B, hence the id-expression is transformed into a class member access expression, however, according to [expr.prim.this] p5
The expression this shall not appear in any other context.
The transformation makes an ill-formed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read [class.mfct.non-static] p3 alongside [expr.prim.this] p5 and the example involving decltype(d) in a member declaration. Determine how the transformation should interact with contexts where this is not permitted, then update the relevant standard wording so the example's validity is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100