Consider fixed size array members when checking for recursive structs.

This commit is contained in:
Daniel Kirchner 2018-07-12 15:09:34 +02:00
parent 5d8a8f7265
commit d4dfd28694

View File

@ -607,6 +607,12 @@ bool TypeChecker::visit(StructDefinition const& _struct)
auto const& typeName = dynamic_cast<UserDefinedTypeName const&>(*member->typeName());
check(&dynamic_cast<StructDefinition const&>(*typeName.annotation().referencedDeclaration), parents);
}
else if (auto arrayType = dynamic_cast<ArrayType const*>(type(*member).get()))
{
if (!arrayType->isDynamicallySized())
if (auto structType = dynamic_cast<StructType const*>(arrayType->baseType().get()))
check(&structType->structDefinition(), parents);
}
};
check(&_struct, StructPointersSet{});