Skip to content

Commit

Permalink
bugzilla 2029 Typesafe variadic functions don't work in CTFE
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Bright committed Dec 29, 2009
1 parent f1a5ce5 commit afabd78
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aggregate.h
Expand Up @@ -131,6 +131,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();
Expand Down
16 changes: 16 additions & 0 deletions src/struct.c
Expand Up @@ -450,6 +450,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;

Expand Down

0 comments on commit afabd78

Please sign in to comment.