Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/ext/flexary10.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/68490 - error initializing a structure with a flexible array member |
2 // { dg-do compile } | |
3 // { dg-options "-Wpedantic" } | |
4 | |
5 struct A { | |
6 int n; | |
145 | 7 int a[]; // { dg-warning "7:ISO C\\+\\+ forbids flexible array member" } |
111 | 8 }; |
9 | |
10 struct A foo (void) | |
11 { | |
12 // Verify the initializer below is accepted for compatibility with gcc | |
13 // (in C mode). | |
14 static struct A | |
15 a = { 2, { 1, 0 } }; // { dg-warning "initialization of a flexible array member" } | |
16 | |
17 return a; | |
18 } |