[Bug c++/88362] attribute aligned silently ignored on C++ references
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 5 09:46:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88362
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
But isn't alignof (r) the alignment of the 'int' while alignof (p) is the
alignment of the pointer?!
That is, alignof(&r) should produce 64, no? Seems to produce 8 for me.
Still your test is bougs?
Btw, alignof(*p) produces 4 as well, consistent with that for r.
I think to align the pointer you need a typedef, attribute placement doesn't
allow distinguishing between pointed-to vs. pointer type the same way
as qualifiers do.
More information about the Gcc-bugs
mailing list