Title
Protected access rule for a pointer-to-member from a reflect-expression
Status
tentatively ready
Section
7.6.2.10 [expr.reflect]
Submitter
Brian Bi

Created on 2026-02-17.00:00:00 last changed 1 week ago

Messages

Date: 2026-05-20.07:01:56

Proposed resolution (approved by CWG 2026-05-19):

Change in 7.6.2.10 [expr.reflect] bullet 7.2 as follows:

A reflect-expression R of the form ^^id-expression represents an entity determined as follows:
  • ...
  • Otherwise, if the id-expression denotes an overload set S, overload resolution for the expression &S with no target shall select a unique function (12.3 [over.over]) the expression &id-expression shall be well-formed when considered as an unevaluated operand, except that the function F selected as described in 12.3 [over.over] may be deleted (9.6.3 [dcl.fct.def.delete]); R represents that function F .
Date: 2026-05-09.19:17:36

CWG 2026-05-08

Reflection supports deleted functions, but the phrasing above does not.

Date: 2026-05-14.22:03:17

Suggested resolution [SUPERSEDED]:

Change in 7.6.2.10 [expr.reflect] bullet 7.2 as follows:

A reflect-expression R of the form ^^id-expression represents an entity determined as follows:
  • ...
  • Otherwise, if the id-expression denotes an overload set S, overload resolution for the expression &S with no target shall select a unique function (12.3 [over.over]) the expression &id-expression shall be well-formed when considered as an unevaluated operand; R represents that the function selected by overload resolution (12.3 [over.over]).
Date: 2026-02-17.00:00:00

(From submission #852.)

Consider:

  class A {
  protected:
    void f();
  };

  struct B : A {
    static constexpr auto r = ^^A::f;
  };

Do the restrictions in 11.8.5 [class.protected] on the use of expression &A::f apply to the reflect-expression?

History
Date User Action Args
2026-05-20 07:01:56adminsetstatus: drafting -> tentatively ready
2026-05-14 22:03:17adminsetmessages: + msg8578
2026-05-09 19:17:36adminsetmessages: + msg8575
2026-05-09 19:17:36adminsetstatus: open -> drafting
2026-03-11 22:41:11adminsetmessages: + msg8509
2026-02-17 00:00:00admincreate