Flexible array member added, zero sized structs removed.

This commit is contained in:
Christoffer Lerno
2021-12-14 18:53:23 +01:00
parent 5ddbf50e83
commit 680b077eb1
30 changed files with 252 additions and 35 deletions

View File

@@ -0,0 +1,31 @@
struct Foo
{
int x;
int[*] y; // #error: flexible array member must be the last element
int z;
}
struct Bar
{
int[*] y; // #error: flexible array member cannot be the only element
}
struct Baz
{
int y;
int[*] z;
}
struct BazContainerOk
{
int z;
Baz c;
}
struct BazContainer
{
Baz c; // #error: A struct member with a flexible array must be the last element.
int y;
}
Baz[5] ab; // #error: Arrays of structs with flexible array members is not allowed.