// PR c++/71147 - [6 Regression] Flexible array member wrongly rejected // in template // { dg-do compile } // { dg-options "-Wpedantic -Wno-error=pedantic" } template struct container { struct elem { unsigned u; }; struct incomplete { int x; elem array[]; // { dg-warning "10:ISO C\\+\\+ forbids flexible array member" } }; }; unsigned f (container::incomplete* i) { return i->array [0].u; } template struct D: container { struct S { int x; typename container::elem array[]; // { dg-warning "33:ISO C\\+\\+ forbids flexible array member" } }; }; unsigned g (D::S *s) { return s->array [0].u; }