]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/initlist102.C
aarch64: Further renaming of generic code
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist102.C
CommitLineData
e58c9d92
MP
1// PR c++/85977, Incorrect handling of array reference size deduction
2// { dg-do compile { target c++11 } }
3
4template <int N>
5void fn1 (const char (&)[N]) { static_assert (N == 3, "fn1");}
6
7template <int N>
8void fn2 (const short (&)[N]) { static_assert (N == 3, "fn2");}
9
10template <int N>
11void fn3 (const int (&)[N]) { static_assert (N == 3, "fn2");}
12
13template <int N>
14void fn4 (const long (&)[N]) { static_assert (N == 3, "fn4");}
15
16template <int N>
17void fn5 (const unsigned char (&)[N]) { static_assert (N == 3, "fn5");}
18
19template <int N>
20void fn6 (const unsigned short (&)[N]) { static_assert (N == 3, "fn6");}
21
22template <int N>
23void fn7 (const unsigned int (&)[N]) { static_assert (N == 3, "fn7");}
24
25template <int N>
26void fn8 (const unsigned int (&)[N]) { static_assert (N == 3, "fn8");}
27
28void
29bar ()
30{
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});
39}