c++: hash table ICE with variadic alias [PR105003]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist102.C
blobe114866292fcd68f9aa66b15b3b08f9f73c1329f
1 // PR c++/85977, Incorrect handling of array reference size deduction
2 // { dg-do compile { target c++11 } }
4 template <int N>
5 void fn1 (const char (&)[N]) { static_assert (N == 3, "fn1");}
7 template <int N>
8 void fn2 (const short (&)[N]) { static_assert (N == 3, "fn2");}
10 template <int N>
11 void fn3 (const int (&)[N]) { static_assert (N == 3, "fn2");}
13 template <int N>
14 void fn4 (const long (&)[N]) { static_assert (N == 3, "fn4");}
16 template <int N>
17 void fn5 (const unsigned char (&)[N]) { static_assert (N == 3, "fn5");}
19 template <int N>
20 void fn6 (const unsigned short (&)[N]) { static_assert (N == 3, "fn6");}
22 template <int N>
23 void fn7 (const unsigned int (&)[N]) { static_assert (N == 3, "fn7");}
25 template <int N>
26 void fn8 (const unsigned int (&)[N]) { static_assert (N == 3, "fn8");}
28 void
29 bar ()
31   fn1 ({1, 2, 3});
32   fn2 ({1, 2, 3});
33   fn3 ({1, 2, 3});
34   fn4 ({1, 2, 3});
35   fn5 ({1, 2, 3});
36   fn6 ({1, 2, 3});
37   fn7 ({1, 2, 3});
38   fn8 ({1, 2, 3});