This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
meta::access_context should be a consteval-only typeSection: 21.4.8 [meta.reflection.access.context] Status: New Submitter: Jakub Jelinek Opened: 2025-10-20 Last modified: 2025-10-23
Priority: 2
View all issues with New status.
Discussion:
The meta::access_context type is expected to contain some meta::info
objects, which would make it a consteval-only type. But we don't actually
specify any members, so nothing in the current specification says you can't
persist one until runtime.
[2025-10-23; Reflector poll. Adjust proposed wording.]
Set priority to 2 after reflector poll.
Reflector discussion requested that 'non-aggregate' and 'consteval-only' both be put in paragraph 3, adjacent to 'structural'. Also added a drive-by editorial change to paragraph 1.
Proposed resolution:
This wording is relative to N5014.
Modify 21.4.8 [meta.reflection.access.context] as indicated:
-1- The class
access_contextclass is a non-aggregate type thatrepresents a namespace, class, or function from which queries pertaining to access rules may be performed, as well as the designating class (11.8.3 [class.access.base]), if any.-2- An
access_contexthas an associated scope and designating class.namespace std::meta { struct access_context { access_context() = delete; consteval info scope() const; consteval info designating_class() const; static consteval access_context current() noexcept; static consteval access_context unprivileged() noexcept; static consteval access_context unchecked() noexcept; consteval access_context via(info cls) const; }; }-3-
access_contextis a structural, consteval-only, non-aggregate type. Two valuesac1andac2of typeaccess_contextare template-argument-equivalent (13.6 [temp.type]) ifac1.scope()andac2.scope()are template-argument-equivalent andac1.designating_class()andac2.designating_class()are template-argument-equivalent.