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

Created on 2022-12-02.00:00:00 last changed 3 weeks 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: 2022-12-02.00:00:00

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

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