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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to David Merillat from comment #0)
>         DefaultStruct s;
>         printf( "DefaultStruct: offset=%d, struct align=%d, member align=%d,
> type align=%d\n", 
>                 offsetof(DefaultStruct,i64), alignof(s), alignof(s.i64),
> alignof(int64_t) );

N.B. this isn't valid C++ or C, because the operand of alignof must be a type,
not an object.

So standard C++ doesn't even let you ask for alignof(s.i64), it only lets you
ask for the alignment of uint64_t, which for a not-sub-object is 8.

Reply via email to