tree: Don't reuse types if TYPE_USER_ALIGN differ [PR94775]
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wpadded-1.C
blobaf375a4d055df5ffbaa9f93509882112e366c729
1 // PR c++/79900 - ICE in strip_typedefs
2 // { dg-do compile }
3 // { dg-options "-Wpadded" }
5 template <class> struct A;
6 template <typename> struct B { // { dg-warning "padding struct size to alignment boundary" }
7   long long _M_off;
8   char _M_state;
9 };
10 template <> struct A<char> { typedef B<int> pos_type; };
11 enum _Ios_Openmode {};
12 struct C {
13   typedef _Ios_Openmode openmode;
15 template <typename, typename _Traits> struct D {
16   typedef typename _Traits::pos_type pos_type;
17   pos_type m_fn1(pos_type, C::openmode);
19 template class D<char, A<char> >;
20 template <typename _CharT, typename _Traits>
21 typename D<_CharT, _Traits>::pos_type D<_CharT, _Traits>::m_fn1(pos_type x,
22                                                                 C::openmode) { return x; }