diff --git a/dmd/aggregate.h b/dmd/aggregate.h index 0aff12ab..6232b82c 100644 --- a/dmd/aggregate.h +++ b/dmd/aggregate.h @@ -150,6 +150,7 @@ struct StructDeclaration : AggregateDeclaration StructDeclaration(Loc loc, Identifier *id); Dsymbol *syntaxCopy(Dsymbol *s); void semantic(Scope *sc); + Dsymbol *search(Loc, Identifier *ident, int flags); void toCBuffer(OutBuffer *buf, HdrGenState *hgs); char *mangle(); const char *kind(); diff --git a/dmd/struct.c b/dmd/struct.c index 3eb70a3b..27d21978 100644 --- a/dmd/struct.c +++ b/dmd/struct.c @@ -460,6 +460,22 @@ void StructDeclaration::semantic(Scope *sc) } } +Dsymbol *StructDeclaration::search(Loc loc, Identifier *ident, int flags) +{ + //printf("%s.StructDeclaration::search('%s')\n", toChars(), ident->toChars()); + + if (scope) + semantic(scope); + + if (!members || !symtab) + { + error("is forward referenced when looking for '%s'", ident->toChars()); + return NULL; + } + + return ScopeDsymbol::search(loc, ident, flags); +} + void StructDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) { int i;