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::define_aggregate should require a class typeSection: 21.4.16 [meta.reflection.define.aggregate] Status: New Submitter: Jakub Jelinek Opened: 2025-10-20 Last modified: 2025-10-20
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 New status.
Discussion:
The meta::define_aggregate function doesn't say what happens if C
does not represent a class type.
It's also unclear whether it should work with aliases to class types, e.g.
struct S; using A = S; ... meta::define_aggregate(^^A, {});
And what happens if you try to define a cv-qualified type:
struct S; meta::define_aggregate(^^const S, {});
Should this be an error, or inject a definition of the unqualified type?
Proposed resolution:
This wording is relative to N5014.
Modify 21.4.16 [meta.reflection.define.aggregate] as indicated:
-7- Let C be the class represented by
dealias(class_type)and rK be the Kth reflection value inmdescrs. For every rK inmdescrs, let (TK, NK, AK, WK, NUAK) be the corresponding data member description represented by rK.-8- Constant when:
- (8.?) —
dealias(class_type)represents a class type;- (8.1) — C is incomplete from every point in the evaluation context;