mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-01 12:33:13 +01:00
Added error instead of assertion failure when trying to get !TypeInfo for a forward declared struct.
This commit is contained in:
@@ -652,6 +652,14 @@ void TypeInfoStructDeclaration::llvmDefine()
|
||||
assert(tinfo->ty == Tstruct);
|
||||
TypeStruct *tc = (TypeStruct *)tinfo;
|
||||
StructDeclaration *sd = tc->sym;
|
||||
|
||||
// can't emit typeinfo for forward declarations
|
||||
if (sd->sizeok != 1)
|
||||
{
|
||||
sd->error("cannot emit TypeInfo for forward declaration");
|
||||
fatal();
|
||||
}
|
||||
|
||||
sd->codegen(Type::sir);
|
||||
|
||||
ClassDeclaration* base = Type::typeinfostruct;
|
||||
|
||||
Reference in New Issue
Block a user