[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / flexarray-mangle.C
blob658d9355a9c74899d3bcfac9746368e16318396d
1 // PR c++/69277 - [6 Regression] ICE mangling a flexible array member
2 // { dg-do compile }
3 // { dg-additional-options "-Wno-error=pedantic" }
5 struct A {
6   int n;
7   char a[];   // { dg-warning "forbids flexible array member" }
8 };
10 // Declare but do not define function templates.
11 template <typename T>
12 void fooref (T&);
14 void bar (A a)
16   fooref (a.a);
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.
24 // void fooref<char []>(char (&) [])
25 // { dg-final { scan-assembler _Z6foorefIA_cEvRT_ } }