comparison gcc/testsuite/g++.dg/cpp2a/array-conv15.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
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, int const(&)[2]) { return 1; }
5 int f(double, int const(&)[2]) { return 2; }
6
7 int f2(int, int const(&)[1]) { return 1; }
8 int f2(int, int const(&)[2]) { return 2; }
9
10 int f3(int, int const(&)[]) { return 1; }
11 int f3(double, int const(&)[]) { return 2; }
12
13 int main ()
14 {
15 if (f (1, {1}) != 1)
16 __builtin_abort ();
17
18 if (f2 (1, {1}) != 1)
19 __builtin_abort ();
20
21 if (f3 (1, {1}) != 1)
22 __builtin_abort ();
23 }