]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/initlist-array8.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist-array8.C
1 // PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
2 // { dg-do run { target c++2a } }
3
4 int f(int (&)[1][1]) { return 1; }
5 int f(int (&)[1][2]) { return 2; }
6
7 int g(int (&&)[2][1]) { return 1; }
8 int g(int (&&)[2][2]) { return 2; }
9
10 int h(int (&&)[][1]) { return 1; }
11 int h(int (&&)[][2]) { return 2; }
12
13 int
14 main ()
15 {
16 int arr1[1][1];
17 int arr2[1][2];
18
19 if (f(arr1) != 1)
20 __builtin_abort ();
21 if (f(arr2) != 2)
22 __builtin_abort ();
23
24 if (g({ { 1, 2 }, { 3 } }) != 2)
25 __builtin_abort ();
26
27 if (g({ { 1, 2 }, { 3, 4 } }) != 2)
28 __builtin_abort ();
29
30 if (h({ { 1, 2 }, { 3 } }) != 2)
31 __builtin_abort ();
32
33 if (h({ { 1, 2 }, { 3, 4 } }) != 2)
34 __builtin_abort ();
35 }
This page took 0.037549 seconds and 5 git commands to generate.