You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class-name is also bound in the scope of the class (template) itself; this is known as the injected-class-name. For purposes of access checking, the injected-class-name is treated as if it were a public member name.
However, we never regulate a corresponding rule for how a lookup can find the injected-class-name from a point P. Since [basic.lookup.general] p3 states that
A single search in a scope S for a name N from a program point P finds all declarations that precede P to which any name that is the same as N ([basic.pre]) is bound in S.
So, what is the locus of the injected-class-name? we can determine whether the name can be found only if we know whether the declaration of that name precedes a point where we start to find the name. This point is unclear in the current draft(also, never be clear in the earlier versions). This should be clarified.
There are two ways to clarify this point.
For purposes of lookup and access checking, the injected-class-name is treated as if it were introduced by a public member declaration of that name whose locus is immediately after the enclosing { of the class-specifier.
However, it seems it may conflict with [class.mem.general] p21
If T is the name of a class, then each of the following shall have a name different from T:
[...]
every member of class T that is itself a type;
The second one is
The class-name is also bound in the scope of the class (template) itself; this is known as the injected-class-name. A search in the scope of the class(template) from any point after the enclosing { of the class-specifier can find a hypothetical declaration associated with the name. For purposes of access checking, the injected-class-name is treated as if it were a public member name.
This is a minimum modification and wouldn't impact the current wording.
The text was updated successfully, but these errors were encountered:
[class.pre] p2 states
However, we never regulate a corresponding rule for how a lookup can find the injected-class-name from a point
P
. Since [basic.lookup.general] p3 states thatSo, what is the locus of the injected-class-name? we can determine whether the name can be found only if we know whether the declaration of that name precedes a point where we start to find the name. This point is unclear in the current draft(also, never be clear in the earlier versions). This should be clarified.
There are two ways to clarify this point.
However, it seems it may conflict with [class.mem.general] p21
The second one is
This is a minimum modification and wouldn't impact the current wording.
The text was updated successfully, but these errors were encountered: