This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


1437. alignas in alias-declaration

Section: 9.2.4  [dcl.typedef]     Status: CD3     Submitter: Daveed Vandevoorde     Date: 2012-01-02

[Moved to DR at the April, 2013 meeting.]

Consider the following:

    struct S { int i; };
    using A alignas(alignof(long long)) = S;

9.12.2 [dcl.align] paragraph 1 allows an alignment-specifier to be applied to the declaration of a class or enumeration type, which A arguably is. The specification should be clarified to indicate that such a usage is not permitted, however.

Proposed resolution (October, 2012):

Change 9.12.2 [dcl.align] paragraph 1 as follows:

An alignment-specifier may be applied to a variable or to a class data member, but it shall not be applied to a bit-field, a function parameter, the formal parameter of a catch clause an exception-declaration (14.4 [except.handle]), or a variable declared with the register storage class specifier. An alignment-specifier may also be applied to the declaration of a class or enumeration type or definition of a class (in an elaborated-type-specifier (9.2.9.5 [dcl.type.elab]) or class-head ( Clause 11 [class]), respectively) and to the declaration or definition of an enumeration (in an opaque-enum-declaration or enum-head, respectively (9.7.1 [dcl.enum])). An alignment-specifier with an ellipsis is a pack expansion (13.7.4 [temp.variadic]).