Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/ext/flexary11.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/69253 - [6 Regression] g++ ICE at -O0 on x86_64-linux-gnu |
2 // in "cxx_incomplete_type_diagnostic" | |
3 // { dg-do compile } | |
4 | |
5 struct A { | |
6 int n; | |
145 | 7 char a[]; // { dg-error "8:ISO C\\+\\+ forbids flexible array member" } |
111 | 8 }; |
9 | |
10 void f () | |
11 { | |
12 // Compound literals and flexible array members are G++ extensions | |
13 // accepted for compatibility with C and GCC. | |
14 | |
15 // The following use of a flexible array member in a compound literal | |
16 // is invalid in C and rejected by GCC in C mode and so it's also | |
17 // rejected in C++ mode. | |
18 (struct A){ 1, "" }; // { dg-error "forbids compound-literals|initialization of a flexible array member|invalid use of a flexible array member" } | |
19 } |