1 // PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
2 // { dg-do run { target c++2a } }
3
4 // Ranking of reference initialization conversions
5
f1(const int (&)[])6 int f1(const int(&)[]) { return 1; }
f1(const int (&)[1])7 int f1(const int(&)[1]) { return 2; }
8
f2(const int (&)[])9 int f2(const int(&)[]) { return 1; }
f2(int (&)[1])10 int f2(int(&)[1]) { return 2; }
11
f3(int (&)[])12 int f3(int(&)[]) { return 1; }
f3(const int (&)[1])13 int f3(const int(&)[1]) { return 2; }
14
15 const int arr[1] = { 42 };
16
17 int
main()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 }
29