On Wed, Aug 7, 2013 at 5:04 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Aug 7, 2013 at 2:58 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br></div><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>> Should foo[n] really return different results depending on the value of<br>
> n? That feels wrong to me.<br>
<br>
</div>This is (and was) the odd case for x86_64. We accept but gcc rejects this<br>
<br>
-----------------------------<br>
long long int foo[1];<br>
long long int bar[2];<br>
<br>
static_assert(alignof(foo) == 8, "foo");<br>
static_assert(alignof(bar) == 16, "bar");<br>
-----------------------------<br>
<br>
Richard, gcc is correct in here, right?</blockquote><div><br></div></div><div>To quote Clang, 'alignof' applied to an expression is a GNU extension. Thus we should presumably do what GCC does -- C++ doesn't have a notion of the alignment of a declaration as distinct from the alignment of its type.</div>
</div></blockquote><div><br></div><div>OK, so that's not strictly-speaking true, but it doesn't have a notion of the alignment being increased because all globals happen to be 16-byte aligned on the target system.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div> </div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 If so I can try to code a<br>
patch replacing RefAsPointee with a more generic ForAlignof.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div></div><br>
</blockquote></div><br>