diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/attrib17.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attrib17.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/attrib17.C b/gcc/testsuite/g++.dg/ext/attrib17.C new file mode 100644 index 000000000..43cf264f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib17.C @@ -0,0 +1,19 @@ +// { dg-do compile } +// Origin: Benjamin Kosnik <bkoz at gcc dot gnu dot org> +// PR c++/17743: Attributes applied to typedefs. + +struct A { + typedef char layout_type[sizeof(double)] + __attribute__((aligned(__alignof__(double)))); + layout_type data; +}; + +struct B { + typedef char layout_type[sizeof(double)]; + layout_type data __attribute__((aligned(__alignof__(double)))); +}; + +template<bool> struct StaticAssert; +template<> struct StaticAssert<true> {}; + +StaticAssert<__alignof__(A) == __alignof__(B)> a1; |