gcc/testsuite/g++.dg/cpp2a/array-conv11.C
raw| 1 | // PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound. |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // { dg-options "-Wpedantic" } |
| 4 | |
| 5 | // Test flexible array member. Here we're binding int[] to int[]. This worked |
| 6 | // even before P0388R4. |
| 7 | |
| 8 | typedef int T[]; |
| 9 | extern T arr; |
| 10 | T &t1 = arr; |
| 11 | |
| 12 | struct S { |
| 13 | int i; |
| 14 | int a[]; // { dg-warning "flexible array member" } |
| 15 | }; |
| 16 | |
| 17 | void f (int (&)[]); |
| 18 | |
| 19 | void |
| 20 | test (S s) |
| 21 | { |
| 22 | f (s.a); |
| 23 | } |