Title
Inconsistent use of T and C
Status
ready
Section
6.5.2 [class.member.lookup]
Submitter
US

Created on 2022-11-03.00:00:00 last changed 3 weeks ago

Messages

Date: 2023-01-07.14:04:02

Proposed resolution (approved by CWG 2023-01-06):

  1. Change in 6.5.2 [class.member.lookup] paragraph 1 as follows:

    A search in a scope X for a name N M from a program point P is a single search in X for N M from P unless X is the scope of a class or class template T, in which case the following steps define the result of the search. [Note 1: The result differs only if N M is a conversion-function-id or if the single search would find nothing. —end note]
  2. Change in 6.5.2 [class.member.lookup] paragraph 2 as follows:

    The lookup set for a name N in a class or class template C, called S(N, C), consists of two component sets: the declaration set, a set of members named N ; and the subobject set, a set of subobjects where declarations of these members were found (possibly via using-declarations). In the declaration set, type declarations (including injected-class-names) are replaced by the types they designate. S(N, C) is calculated as follows:
  3. Change in 6.5.2 [class.member.lookup] paragraph 4 as follows:

    ... [Note 2: If T C is incomplete, only base classes whose base-specifier appears before P are considered. If T C is an instantiated class, its base classes are not dependent. —end note]
  4. Change in 6.5.2 [class.member.lookup] paragraph 6 as follows:

    The result of the search is the declaration set of S(NM, T). If it is an invalid set, the program is ill-formed. If it differs from the result of a search in T for N M in a complete-class context (11.4 [class.mem]) of T , the program is ill-formed, no diagnostic required.
  5. Change in 6.5.2 [class.member.lookup] paragraph 7 as follows:

    If N M is a non-dependent conversion-function-id, conversion function templates that are members of T are considered. For each such template F, the lookup set S(t, T) is constructed, considering a function template declaration to have the name t only if it corresponds to a declaration of F (6.4.1 [basic.scope.scope]). The members of the declaration set of each such lookup set, which shall not be an invalid set, are included in the result.
Date: 2023-01-07.14:04:02

CWG 2022-12-02

The resolution proposed above is incorrect: T is the parameter for the overall search and C is the parameter for the S(N,C) construction. Highlight that fact in paragraph 2.

Date: 2022-12-03.19:11:33

Proposed resolution [SUPERSEDED]:

  1. Change in 6.5.2 [class.member.lookup] paragraph 1 as follows:

    A search in a scope X for a name N from a program point P is a single search in X for N from P unless X is the scope of a class or class template T C, in which case the following steps define the result of the search.
  2. Change in 6.5.2 [class.member.lookup] paragraph 4 as follows:

    [Note 2: If T C is incomplete, only base classes whose base-specifier appears before P are considered. If T C is an instantiated class, its base classes are not dependent. —end note]
  3. Change in 6.5.2 [class.member.lookup] paragraph 6 as follows:

    The result of the search is the declaration set of S(N, T C). If it is an invalid set, the program is ill-formed. If it differs from the result of a search in T C for N in a complete-class context (11.4 [class.mem]) of T C, the program is ill-formed, no diagnostic required.
  4. Change in 6.5.2 [class.member.lookup] paragraph 7 as follows:

    If N is a non-dependent conversion-function-id, conversion function templates that are members of T C are considered. For each such template F, the lookup set S(t, T C) is constructed, considering a function template declaration to have the name t only if it corresponds to a declaration of F (6.4.1 [basic.scope.scope]).
  5. Change in 6.5.2 [class.member.lookup] paragraph 8 as follows:

    [Note 4: A static member, a nested type or an enumerator defined in a base class T B can unambiguously be found even if an object has more than one base class subobject of type T B. Two base class subobjects share the non-static member subobjects of their common virtual base classes. —end note]
Date: 2022-12-03.19:11:33
P2720R0 comment US 7-035

T and C are used inconsistently throughout these paragraphs.

History
Date User Action Args
2023-01-07 14:04:02adminsetmessages: + msg7116
2023-01-07 14:04:02adminsetstatus: review -> ready
2022-12-03 19:11:33adminsetmessages: + msg7075
2022-11-27 21:00:51adminsetstatus: dr -> review
2022-11-25 05:14:04adminsetstatus: nb -> dr
2022-11-08 07:00:55adminsetstatus: review -> nb
2022-11-08 07:00:55adminsetstatus: review -> review
2022-11-08 07:00:55adminsetstatus: review -> review
2022-11-08 07:00:55adminsetstatus: review -> review
2022-11-08 07:00:55adminsetstatus: review -> review
2022-11-08 07:00:55adminsetmessages: + msg6971
2022-11-08 07:00:55adminsetstatus: review -> review
2022-11-07 21:52:17adminsetstatus: open -> review
2022-11-07 21:52:17adminsetstatus: open -> open
2022-11-07 21:52:17adminsetstatus: open -> open
2022-11-07 21:52:17adminsetstatus: open -> open
2022-11-07 21:52:17adminsetstatus: open -> open
2022-11-07 21:52:17adminsetstatus: open -> open
2022-11-07 13:18:36adminsetstatus: nb -> open
2022-11-07 13:18:36adminsetstatus: nb -> nb
2022-11-07 13:18:36adminsetstatus: nb -> nb
2022-11-03 00:00:00admincreate