aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/array-conv4.C
blob: 3f6f92c1fedff238825ba36ef4474fb4304889b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++20 } }

// Ranking of reference initialization conversions

void f(int(&)[]) {}	    // (1)
//void f(int(&)[1]) { }	    // (2)
void f(int*) { }	    // (3)

//void f2(int(&)[]) { }	    // (1)
void f2(int(&)[1]) { }	    // (2)
void f2(int*) { }	    // (3)

// From P0388R4:
// (3) should be equal to (1) (as it is to (2))
// Check that we get "ambiguous overload" errors.

void
doit ()
{
  int arr[1];
  f(arr); // { dg-error "ambiguous" }
  f2(arr); // { dg-error "ambiguous" }
}