This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Immediate status.

4449. define_aggregate members must be public

Section: 21.4.16 [meta.reflection.define.aggregate] Status: Immediate Submitter: Daniel Katz Opened: 2025-11-05 Last modified: 2025-11-05

Priority: Not Prioritized

View other active issues in [meta.reflection.define.aggregate].

View all other issues in [meta.reflection.define.aggregate].

View all issues with Immediate status.

Discussion:

The access of members of classes defined by injected declarations produced by evaluations of std::meta::define_aggregate is unspecified.

[Kona 2025-11-05; approved by LWG. Status changed: New → Immediate.]

Proposed resolution:

This wording is relative to N5014.

  1. Modify 21.4.16 [meta.reflection.define.aggregate] as indicated:

    template<reflection_range R = initializer_list<info>>
      consteval info define_aggregate(info class_type, R&& mdescrs);
    

    -7- Let C be the class represented by class_type and rK be the Kth reflection value in mdescrs. […]

    -8- Constant When: […]

    -9- Effects: Produces an injected declaration D (7.7 [expr.const]) that defines C and has properties as follows:

    • (9.1) — […]
    • (9.2) — […]
    • (9.3) — […]
    • (9.4) — […]
    • (9.5) — For each rK, there is a corresponding entity MK with public access belonging to the class scope of D with the following properties: […]
    • (9.6) — […]