| 1 |
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound. |
| 2 |
// { dg-do run { target c++20 } } |
| 3 |
|
| 4 |
// Ranking of reference initialization conversions |
| 5 |
|
| 6 |
int f1(const int(&)[]) { return 1; } |
| 7 |
int f1(const int(&)[1]) { return 2; } |
| 8 |
|
| 9 |
int f2(const int(&)[]) { return 1; } |
| 10 |
int f2(int(&)[1]) { return 2; } |
| 11 |
|
| 12 |
int f3(int(&)[]) { return 1; } |
| 13 |
int f3(const int(&)[1]) { return 2; } |
| 14 |
|
| 15 |
const int arr[1] = { 42 }; |
| 16 |
|
| 17 |
int |
| 18 |
main () |
| 19 |
{ |
| 20 |
if (f1(arr) != 2) |
| 21 |
__builtin_abort (); |
| 22 |
|
| 23 |
if (f2(arr) != 1) |
| 24 |
__builtin_abort (); |
| 25 |
|
| 26 |
if (f3(arr) != 2) |
| 27 |
__builtin_abort (); |
| 28 |
} |