Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/array-14.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do compile } */ |
2 /* { dg-options "" } */ | |
3 | |
4 /* Verify that GCC forbids non-static initialization of | |
5 flexible array members. */ | |
6 | |
7 typedef char T[]; | |
8 struct str { int len; T s; }; | |
9 | |
10 struct str a = { 2, "a" }; | |
11 | |
12 void foo() | |
13 { | |
14 static struct str b = { 2, "b" }; | |
15 struct str c = { 2, "c" }; /* { dg-error "(non-static)|(near initialization)" } */ | |
16 struct str d = (struct str) { 2, "d" }; /* { dg-error "(non-static)|(near initialization)" } */ | |
17 struct str e = (struct str) { d.len, "e" }; /* { dg-error "(non-static)|(initialization)" } */ | |
18 } |