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

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
I would think for the same reason why attribute aligned applies to the
reference and not to the type it refers to.  If it makes sense for the
following to declare an overaligned reference to an ordinary int rather than a
reference to an overaligned int then it should also make sense to ask how the
reference is aligned and get the right answer.

  extern __attribute__ ((aligned (64))) int &r;

But if the alignment of the reference isn't important (and I think that
argument could very well be made because references are mostly transparent to
users) then specifying the attribute on its declaration might as well mean that
it applies to the type of the referrent (or both).

But the current semantics of the attribute declaring an overaligned reference
don't seem very useful; more likely it's going to be a mistake.

Reply via email to