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
[basic.lookup.qual.general] p2 define the lookup context:
The lookup context of a member-qualified name is the type of its associated object expression (considered dependent if the object expression is type-dependent). The lookup context of any other qualified name is the type, template, or namespace nominated by the preceding nested-name-specifier.
[basic.lookup.qual.general] p3 states
Qualified name lookup in a class, namespace, or enumeration performs a search of the scope associated with it ([class.member.lookup]) except as specified below.
Consider a case where the type is not a pure class type
structC{
int c = 0;
};
typedef C const CC;
intmain(){
sizeof(CC::c) + CC{}.c;
}
both the lookup context of c is const-qualified class C. [class.member.lookup] just define the lookup process as:
The declaration set is the result of a single search in the scope of C for N from immediately after the class-specifier of C if P is in a complete-class context of C or from P otherwise.
It didn't state what the result is if the lookup context is const C. [class.pre] p1 state
A class is a type.
[basic.type.qualifier] p1 states
Each type other than a function or reference type is part of a group of four distinct, but related, types
[basic.scope.class] p1 states
Any declaration of a class or class template C introduces a class scope
In the above example, the declaration of class C introduces the scope. Maybe, we could arguably say the scope of C is associated with const C.
In addition, [class.member.lookup] also has an unclear definition
[class.member.lookup] p2 states:
The lookup set for N in C, called S( N, C ) consists of two component sets
The declaration set is the result of a single search in the scope of C for N from immediately after the class-specifier of C
From this point, the symbol C should be a class type. However, that symbol in the following two bullets will be interpreted as an object
If the resulting declaration set is not empty, the subobject set contains C itself, and calculation is complete.
Calculate the lookup set for N in each direct non-dependent ([temp.dep.type]) base class subobject Bi and merge each such lookup set S( N, Bi ) in turn into S( N, C )
Then, [class.member.lookup] p6, in turn, call the second symbol of set S as a class
The result of the search is the declaration set of S( N, T )
where T is previously defined as class or class template T in p1.
The text was updated successfully, but these errors were encountered:
For the first part of this issue, I think [basic.lookup.qual.general] p2 should be changed to
The lookup context of a member-qualified name is the cv-unqualified version of the type of its associated object expression (considered dependent if the object expression is type-dependent). The lookup context of any other qualified name is the cv-unqualified version of the type, template, or namespace nominated by the preceding nested-name-specifier.
This may eliminate the interference that we say lookup performs a search in the scope of a class whereas the lookup context is the cv-qualified that class(type).
[basic.lookup.qual.general] p2 define the lookup context:
[basic.lookup.qual.general] p3 states
Consider a case where the type is not a pure class type
both the lookup context of
c
is const-qualified class C. [class.member.lookup] just define the lookup process as:It didn't state what the result is if the lookup context is
const C
. [class.pre] p1 state[basic.type.qualifier] p1 states
[basic.scope.class] p1 states
In the above example, the declaration of class
C
introduces the scope. Maybe, we could arguably say the scope ofC
is associated withconst C
.In addition, [class.member.lookup] also has an unclear definition
[class.member.lookup] p2 states:
From this point, the symbol
C
should be a class type. However, that symbol in the following two bullets will be interpreted as an objectThen, [class.member.lookup] p6, in turn, call the second symbol of set
S
as a classwhere
T
is previously defined as class or class template T in p1.The text was updated successfully, but these errors were encountered: