Thanks Richard!

On Sat, Dec 1, 2012 at 1:53 AM, Richard Smith <[email protected]> wrote:

> Note that these are actually very different, and Clang currently gets the
>> C++11 one wrong.
>> GCC alignment attribute: makes the *type* be aligned to the specified
>> amount.
>> C++11 alignment attribute: makes the *storage* be aligned to the
>> specified amount. (I think.. I'll check w/ Richard on Monday)
>>
>
> The C++11 attribute can be used in two ways (neither is what you want
> here):
>  * On the declaration of a variable or data member, to overalign the
> storage of that entity
>  * On the definition of a tag type, to overalign all objects of that type
>

Ok, so it can impact a tag type, not a typedef. Cool.

Anyways, I agree it doesn't really help...


> I suppose you could do this:
>
> template<typename T, size_t Align> struct alignas(Align) overaligned { T
> value; };
> void foo(overaligned<double, 16> *a, overaligned<double, 16>) {
>   // ...
> }
>

I think this suffers from the same problem as the typedef and GCC attribute.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to