Debian Codegraph @

gcc/testsuite/g++.dg/ext/pr71290.C

raw
1 // PR c++/71290 - [6/7 Regression] Flexible array member is not diagnosed
2 // with -pedantic
3
4 // { dg-do compile }
5 // { dg-options "-Wall -Wpedantic" }
6
7 struct A
8 {
9 int i;
10 int arr[]; // { dg-warning "7:ISO C\\+\\+ forbids flexible array member .arr." }
11 };
12
13 template <class T>
14 struct B {
15 T n;
16 T a[]; // { dg-warning "5:ISO C\\+\\+ forbids flexible array member .a." }
17 };