This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19163] __attribute__((aligned)) not working in template
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Dec 2004 15:45:04 -0000
- Subject: [Bug c++/19163] __attribute__((aligned)) not working in template
- References: <20041227112454.19163.pcarlini@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2004-12-27 15:45 -------
Hi again! Yes, I can confirm that the patch works fine here: regtests ok and
both the above testcase and the below pass with it, which basically amounts
to making possible a decent implementation of tr1::type_traits::aligned_storage
Thanks Giovanni! Please post your complete work ASAP and let's have this fixed
for 4.0 too, if possible!
//////////////////
struct A
{ typedef char type[4] __attribute__((aligned(4))); };
template<unsigned, unsigned>
struct B;
template<unsigned _Len>
struct B<_Len, 4>
{ typedef char type[_Len] __attribute__((aligned(4))); };
template<bool> struct StaticAssert;
template<> struct StaticAssert<true> {};
StaticAssert<__alignof__(A::type) == __alignof__(B<4, 4>::type)> a1;
StaticAssert<__alignof__(B<4, 4>::type) == 4> a2;
//////////////////
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19163