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

4429. meta::alignment_of should exclude data member description of bit-field

Section: 21.4.11 [meta.reflection.layout] Status: WP Submitter: Tomasz Kamiński Opened: 2025-10-24 Last modified: 2025-11-11

Priority: Not Prioritized

View all issues with WP status.

Discussion:

Addresses US 109-170

21.4.11 [meta.reflection.layout] p#8 This should similarly disallow data member descriptions of bit-fields.

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

[Kona 2025-11-08; Status changed: Immediate → WP.]

Proposed resolution:

This wording is relative to N5014.

  1. Modify 21.4.11 [meta.reflection.layout] as indicated:

    consteval size_t alignment_of(info r);	
    

    -7- Returns: […]

    -8- Throws: meta::exception unless all of the following conditions are met:

    • (8.1) — dealias(r) is a reflection of a type, object, variable of non-reference type, non-static data member that is not a bit-field, direct base class relationship, or data member description (T,N,A,W,NUA) (11.4.1 [class.mem.general]) where W is ⊥..
    • (8.2) — If dealias(r) represents a type, then is_complete_type(r) is true.