diff --git a/gen/typinf.cpp b/gen/typinf.cpp index 1148c5df..3695c789 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -601,6 +601,13 @@ void TypeInfoStructDeclaration::llvmDefine() TypeStruct *tc = static_cast(tinfo); StructDeclaration *sd = tc->sym; + // handle opaque structs + if (!sd->members) { + RTTIBuilder b(Type::typeinfostruct); + b.finalize(ir.irGlobal); + return; + } + // can't emit typeinfo for forward declarations if (sd->sizeok != SIZEOKdone) {