https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124601

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-03-22
     Ever confirmed|0                           |1
            Summary|misleading 'alignof'        |`alignof` or `__alignof__`
                   |diagnostic for              |in diagnostic for
                   |alignas(void)               |`alignas(type)`
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  if (TYPE_P (e))
    /* [dcl.align]/3:

           When the alignment-specifier is of the form
           alignas(type-id), it shall have the same effect as
           alignas(alignof(type-id)).  */

    return cxx_sizeof_or_alignof_type (input_location,
                                       e, ALIGNOF_EXPR,
                                       /*std_alignof=*/true,
                                       /*complain=*/true);



So in theory it is the same.

Well I can tell you this gives __alignof__:
```
class alignas(struct B) A {};
```

Reply via email to