diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/gen-attrs-48.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/gen-attrs-48.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48.C new file mode 100644 index 00000000000..360c093bf5a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48.C @@ -0,0 +1,17 @@ +// { dg-do compile { target c++11 } } + +typedef char layout_type; + +struct A { + layout_type member alignas (double); +}; + +static_assert (alignof (A) == alignof (double), + "alignment of struct A must be alignof (double)"); + +struct alignas (alignof (long double)) B { + layout_type member; +}; + +static_assert (alignof (B) == alignof (long double), + "alignment of struct A must be alignof (double double)"); |