This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Description
With the following:
struct FooArray
{
x : int[3];
}
struct FooWithConstArray
{
array : FooArray const*;
}
func test_const_members() {
foo := FooWithConstArray{};
#assert(foo.array.x[0] == 0);
}
Then when TypeInfo gets written, ion generates:
[53] = &(TypeInfo){TYPE_CONST, .size = sizeof(int (const [3])), .align = alignof(int (const [3])), .base = TYPEID(50, TYPE_ARRAY, int [3])},
the int (const [3]) is not parsed as a valid type expression
Somehow the type entry seems invalid to me, as all arrays in C are const. So the type info should probably not be generated at all (TYPE_CONST with base TYPE_ARRAY)
type_to_cdecl could be instrumented to assert that a TYPE_CONST should not be an array