| 1 |
// PR c++/69277 - [6 Regression] ICE mangling a flexible array member |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-additional-options "-Wno-error=pedantic" } |
| 4 |
|
| 5 |
struct A { |
| 6 |
int n; |
| 7 |
char a[]; // { dg-warning "8:ISO C\\+\\+ forbids flexible array member" } |
| 8 |
}; |
| 9 |
|
| 10 |
// Declare but do not define function templates. |
| 11 |
template <typename T> |
| 12 |
void fooref (T&); |
| 13 |
|
| 14 |
void bar (A a) |
| 15 |
{ |
| 16 |
fooref (a.a); |
| 17 |
} |
| 18 |
|
| 19 |
// In G++ versions prior to 6, flexible array members were incorrectly |
| 20 |
// mangled as arrays of zero elements. Verify that flexible array |
| 21 |
// members are mangled correctly as arrays of an unspecified number |
| 22 |
// of elements. |
| 23 |
|
| 24 |
// void fooref<char []>(char (&) []) |
| 25 |
// { dg-final { scan-assembler _Z6foorefIA_cEvRT_ } } |