[Bug c++/94569] alignas(object) with a weaker (smaller) alignment than the alignas(type) of it's type compiles, inconsistent with the C++ standard

sinbal2l at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 2 10:25:37 GMT 2020


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

--- Comment #7 from Inbal Levi <sinbal2l at gmail dot com> ---
Not exactly.

94594 is talking about object's members impose their alignment on the object's
type, whether this bug is talking about object type imposes its alignment on
every object of that type (notice that in the example here, unlike the one on
94594, there's no alignment of the members). (this restriction is located at: 

  [basic.align/1]

  [...] An object type imposes an alignment requirement on every object of that 
  type; stricter alignment can be requested using the alignment specifier.

as posted below in the comments, unfortunately, since I couldn't edit the bug)

(Though, since posting that bug, I realized that though the restriction should
hold, the querying part, which is alignof(object), should first be qualified in
the standard. There's a paper: P2152 :) )


More information about the Gcc-bugs mailing list