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

2023-01-15


1305. alignof applied to array of unknown size

Section: 7.6.2.6  [expr.alignof]     Status: CD3     Submitter: Nikolay Ivchenkov     Date: 2011-04-26

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

According to 7.6.2.6 [expr.alignof] paragraph 1,

An alignof expression yields the alignment requirement of its operand type. The operand shall be a type-id representing a complete object type or an array thereof or a reference to a complete object type.

This (presumably unintentionally) excludes a reference to an array with an unknown bound but a complete element type; the bound is not needed to determine the alignment of the array.

Proposed resolution (August, 2011):

Change 7.6.2.6 [expr.alignof] paragraph 1 as follows:

An alignof expression yields the alignment requirement of its operand type. The operand shall be a type-id representing a complete object type or an array thereof or a reference to a complete object type one of those types.