4036. __alignof_is_defined is only implicitly specified in C++ and not yet deprecated

Section: D.11 [depr.c.macros] Status: New Submitter: Jiang An Opened: 2024-01-12 Last modified: 2024-01-14 07:43:07 UTC

Priority: Not Prioritized

View all issues with New status.


Currently 17.14.4 [stdalign.h.syn] states

The contents of the C++ header <stdalign.h> are the same as the C standard library header <stdalign.h>, with the following changes: The header <stdalign.h> does not define a macro named alignas.

See also: ISO/IEC 9899:2018, 7.15

which implicitly specifies that __alignof_is_defined is also provided in C++, because C17 specified that the macro is provided in <stdaligh.h>.

However, there's no explicit mentioning of __alignof_is_defined in the C++ standard wording. And D.11 [depr.c.macros]/1 (added by LWG 3827) seemingly contradicts with 17.14.4 [stdalign.h.syn] and only makes __alignas_is_defined deprecated.

It seems that we should explicitly mention __alignof_is_defined in D.11 [depr.c.macros] at this moment.

Proposed resolution:

This wording is relative to N4971.

  1. Modify D.11 [depr.c.macros] as indicated:

    -1- The header <stdalign.h> has the following macros:

    #define __alignas_is_defined 1
    #define __alignof_is_defined 1