Title
`meta::define_aggregate` should require a class type
Status
new
Section
[meta.reflection.define.aggregate]
Submitter
Jakub Jelinek

Created on 2025-10-20.00:00:00 last changed 4 days ago

Messages

Date: 2025-10-27.10:00:32

Proposed resolution:

This wording is relative to N5014.

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

    -7- Let C be the class type represented by class_type and rK be the Kth reflection value in `mdescrs`. For every rK in `mdescrs`, let (TK, NK, AK, WK, NUAK) be the corresponding data member description represented by rK.

    -8- Constant when:

    • (8.?) — `class_type` represents a cv-unqualified class type;
    • (8.1) — C is incomplete from every point in the evaluation context;

Date: 2025-10-27.16:17:32

Proposed resolution:

This wording is relative to N5014.

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

    -7- Let C be the class type represented by class_type and rK be the Kth reflection value in `mdescrs`. For every rK in `mdescrs`, let (TK, NK, AK, WK, NUAK) be the corresponding data member description represented by rK.

    -8- Constant when:

    • (8.?) — `class_type` represents a cv-unqualified class type;
    • (8.1) — C is incomplete from every point in the evaluation context;

Date: 2025-10-15.00:00:00

[ 2025-10-24; LWG telecon. Jonathan updates wording ]

Make a minimal change for now, can add support for aliases later.

Date: 2025-10-15.00:00:00

[ 2025-10-23; Reflector poll. ]

Set priority to 1 after reflector poll.

This wording is relative to N5014.

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

    -7- Let C be the class represented by dealias(class_type) and rK be the Kth reflection value in `mdescrs`. For every rK in `mdescrs`, 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;

Date: 2025-10-27.16:17:32
Addresses US 125-188

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?

History
Date User Action Args
2025-10-27 10:00:32adminsetmessages: + msg15458
2025-10-27 09:58:11adminsetmessages: + msg15454
2025-10-24 17:29:22adminsetmessages: + msg15415
2025-10-20 13:04:18adminsetmessages: + msg15270
2025-10-20 00:00:00admincreate