Title
Differing member lookup from nested classes
Status
cd6
Section
6.5.2 [class.member.lookup]
Submitter
Jason Merrill

Created on 2022-05-02.00:00:00 last changed 27 months ago

Messages

Date: 2022-07-09.05:54:34

Proposed resolution (approved by CWG 2022-05-06):

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

If it differs from the result of a search in T for N from immediately after the class-specifier in a complete-class context of T, the program is ill-formed, no diagnostic required.
Date: 2022-07-15.00:00:00

[Accepted at the July, 2022 meeting.]

Consider:

  typedef int T;
  struct A {
   struct B {
    static T t;
   };
   typedef float T; // IFNDR?
  };

Subclause 6.5.2 [class.member.lookup] paragraph 6 specifies:

The result of the search is the declaration set of S(N, 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 from immediately after the class-specifier of T, the program is ill-formed, no diagnostic required.

It is unclear whether the lookup of T inside A::B is subject to the "if it differs" rule, given that the class-specifier of A::B ends before introducing A::T.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: ready -> cd6
2022-05-06 20:24:57adminsetstatus: open -> ready
2022-05-02 16:09:03adminsetmessages: + msg6821
2022-05-02 00:00:00admincreate