Files
c3c/test/test_suite/struct/flex_array_struct_err.c3
Christoffer Lerno 25bccf4883 New faults and syntax (#2034)
- Remove `[?]` syntax.
- Change `int!` to `int?` syntax.
- New `fault` declarations.
- Enum associated values can reference the calling enum.
2025-03-10 00:11:35 +01:00

31 lines
495 B
Plaintext

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.