This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69560] x86_64: alignof(uint64_t) produces incorrect results with -m32
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Jan 2016 12:38:34 +0000
- Subject: [Bug c++/69560] x86_64: alignof(uint64_t) produces incorrect results with -m32
- Auto-submitted: auto-generated
- References: <bug-69560-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #10)
> (In reply to David Merillat from comment #8)
> > One thing remains. As a result of 52023, C11 _Alignof was "fixed" to return
> > the smallest possible alignment, but C++11 was left alone "deliberately",
> > although "C++11 will need examining to determine what is right for alignof
> > there". I didn't see any such discussion for C++11 or C++14 alignof(), and
> > by my reading of the specifications, they are defined almost identically to
> > C11 _Alignof.
>
> See Joseph's explanation at:
> https://gcc.gnu.org/ml/gcc-patches/2013-12/msg00435.html
Which refers to 3.11 [basic.align] p2:
The alignment required for a type might be different when it is used as the
type of a complete object and when it is used as the type of a subobject.