<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_extra" style>Thanks Richard!</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 1, 2012 at 1:53 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank" class="cremed">richard@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Note that these are actually very different, and Clang currently gets the C++11 one wrong.</div>
<div>GCC alignment attribute: makes the *type* be aligned to the specified amount.</div><div>C++11 alignment attribute: makes the *storage* be aligned to the specified amount. (I think.. I'll check w/ Richard on Monday)</div>
</div></div></div></div></blockquote><div><br></div></div></div><div>The C++11 attribute can be used in two ways (neither is what you want here):</div><div> * On the declaration of a variable or data member, to overalign the storage of that entity</div>
<div> * On the definition of a tag type, to overalign all objects of that type</div></blockquote><div><br></div><div style>Ok, so it can impact a tag type, not a typedef. Cool.</div><div style><br></div><div style>Anyways, I agree it doesn't really help...</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>I suppose you could do this:<br></div><div>
<br></div><div>template<typename T, size_t Align> struct alignas(Align) overaligned { T value; };</div>
<div>void foo(overaligned<double, 16> *a, overaligned<double, 16>) {</div><div> // ...</div><div>}</div></blockquote><div><br></div><div style>I think this suffers from the same problem as the typedef and GCC attribute.</div>
</div></div></div></div>