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

Created on 2026-02-17.00:00:00 last changed yesterday

Messages

Date: 2026-03-11.22:41:11

Suggested resolution:

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-03-11 22:41:11adminsetmessages: + msg8509
2026-02-17 00:00:00admincreate