Title
Example for member access control vs. overload resolution
Status
c++23
Section
11.8.1 [class.access.general]
Submitter
Shafik Yaghmour

Created on 2022-12-02.00:00:00 last changed 9 months ago

Messages

Date: 2023-01-07.14:11:02

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

Change in 11.8.1 [class.access.general] paragraph 4 as follows:

... When a using-declarator is named, access control is applied to it, not to the declarations that replace it. For an overload set, access control is applied only to the function selected by overload resolution.

[ Example:

  struct S {
    void f(int);
  private:
    void f(double);
  };

  void g(S* sp) {
    sp->f(2);    // OK, access control applied after overload resolution
  }

-- end example ]

Date: 2023-02-15.00:00:00

[Accepted as a DR at the February, 2023 meeting.]

Issue 600 was resolved by P1787R6, but no example was added.

History
Date User Action Args
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: dr -> open
2023-02-18 18:43:04adminsetstatus: ready -> dr
2023-01-07 14:11:02adminsetstatus: open -> ready
2022-12-04 20:31:46adminsetmessages: + msg7087
2022-12-02 00:00:00admincreate