mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-31 11:30:05 +02:00
DMD 2.032 Merge.
This commit is contained in:
21
dmd2/class.c
21
dmd2/class.c
@@ -349,6 +349,8 @@ void ClassDeclaration::semantic(Scope *sc)
|
||||
//printf("\ttry later, forward reference of base class %s\n", tc->sym->toChars());
|
||||
scope = scx ? scx : new Scope(*sc);
|
||||
scope->setNoFree();
|
||||
if (tc->sym->scope)
|
||||
tc->sym->scope->module->addDeferredSemantic(tc->sym);
|
||||
scope->module->addDeferredSemantic(this);
|
||||
return;
|
||||
}
|
||||
@@ -402,6 +404,12 @@ void ClassDeclaration::semantic(Scope *sc)
|
||||
error("inherits from duplicate interface %s", b2->base->toChars());
|
||||
}
|
||||
|
||||
if (!tc->sym->symtab)
|
||||
{ // Try to resolve forward reference
|
||||
if (sc->mustsemantic && tc->sym->scope)
|
||||
tc->sym->semantic(NULL);
|
||||
}
|
||||
|
||||
b->base = tc->sym;
|
||||
if (!b->base->symtab || b->base->scope)
|
||||
{
|
||||
@@ -410,6 +418,8 @@ void ClassDeclaration::semantic(Scope *sc)
|
||||
//printf("\ttry later, forward reference of base %s\n", baseClass->toChars());
|
||||
scope = scx ? scx : new Scope(*sc);
|
||||
scope->setNoFree();
|
||||
if (tc->sym->scope)
|
||||
tc->sym->scope->module->addDeferredSemantic(tc->sym);
|
||||
scope->module->addDeferredSemantic(this);
|
||||
return;
|
||||
}
|
||||
@@ -798,8 +808,8 @@ int ClassDeclaration::isBaseOf(ClassDeclaration *cd, int *poffset)
|
||||
Dsymbol *ClassDeclaration::search(Loc loc, Identifier *ident, int flags)
|
||||
{
|
||||
Dsymbol *s;
|
||||
|
||||
//printf("%s.ClassDeclaration::search('%s')\n", toChars(), ident->toChars());
|
||||
|
||||
if (scope)
|
||||
{ Scope *sc = scope;
|
||||
sc->mustsemantic++;
|
||||
@@ -962,10 +972,12 @@ int ClassDeclaration::isCOMinterface()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if DMDV2
|
||||
int ClassDeclaration::isCPPinterface()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************
|
||||
@@ -1142,6 +1154,11 @@ void InterfaceDeclaration::semantic(Scope *sc)
|
||||
baseclasses.remove(i);
|
||||
continue;
|
||||
}
|
||||
if (!b->base->symtab)
|
||||
{ // Try to resolve forward reference
|
||||
if (sc->mustsemantic && b->base->scope)
|
||||
b->base->semantic(NULL);
|
||||
}
|
||||
if (!b->base->symtab || b->base->scope || b->base->inuse)
|
||||
{
|
||||
//error("forward reference of base class %s", baseClass->toChars());
|
||||
@@ -1326,10 +1343,12 @@ int InterfaceDeclaration::isCOMinterface()
|
||||
return com;
|
||||
}
|
||||
|
||||
#if DMDV2
|
||||
int InterfaceDeclaration::isCPPinterface()
|
||||
{
|
||||
return cpp;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user