Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wstrict-aliasing-bogus-char-2.C
blob0f04bf19f0bfe7a3aa247c76b1be03eb67722691
1 // { dg-do compile }
2 // { dg-options "-O2 -Wstrict-aliasing" }
4 template<unsigned _Len, unsigned _Align>
5 struct aligned_storage
7   union type
8     {
9       unsigned char __data[_Len];
10       struct __attribute__((__aligned__((_Align)))) { } __align;
11     };
14 aligned_storage<sizeof(int), __alignof__(int)>::type storage;
16 int main()
18   *reinterpret_cast<int*>(&storage) = 42; // { dg-bogus "break strict-aliasing" }