| 1 |
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list. |
| 2 |
// { dg-do run { target c++20 } } |
| 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 |
} |