[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / underlying_type9.C
blob2c564560e3cfb018172e24c7ad8f89bd58583d1c
1 // { dg-do compile { target c++11 } }
3 template<typename T1, typename T2>
4   struct is_same
5   { static const bool value = false; };
7 template<typename T>
8   struct is_same<T, T>
9   { static const bool value = true; };
11 enum E1 : unsigned { };
12 enum E2 : char { };
13 enum class E3 { };
14 enum class E4 : unsigned char { c = 1 };
15 enum class E5 : int { a = -1, b = 1 };
16 enum class E6 : long { c = __LONG_MAX__ };
18 template<typename T, typename U>
19   struct test
20   {
21     static_assert(is_same<T, U>::value, "Error");
22   };
24 test<__underlying_type(E1), unsigned>       t1;
25 test<__underlying_type(E2), char>           t2;
26 test<__underlying_type(E3), int>            t3;
27 test<__underlying_type(E4), unsigned char>  t4;
28 test<__underlying_type(E5), int>            t5;
29 test<__underlying_type(E6), long>           t6;