mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-29 02:20:04 +02:00
Merge dmdfe 2.053beta
This commit is contained in:
16
dmd2/class.c
16
dmd2/class.c
@@ -1,6 +1,6 @@
|
||||
|
||||
// Compiler implementation of the D programming language
|
||||
// Copyright (c) 1999-2009 by Digital Mars
|
||||
// Copyright (c) 1999-2011 by Digital Mars
|
||||
// All Rights Reserved
|
||||
// written by Walter Bright
|
||||
// http://www.digitalmars.com
|
||||
@@ -839,16 +839,18 @@ int ClassDeclaration::isBaseOf(ClassDeclaration *cd, int *poffset)
|
||||
*poffset = 0;
|
||||
while (cd)
|
||||
{
|
||||
if (this == cd->baseClass)
|
||||
return 1;
|
||||
|
||||
/* cd->baseClass might not be set if cd is forward referenced.
|
||||
*/
|
||||
if (!cd->baseClass && cd->baseclasses->dim && !cd->isInterfaceDeclaration())
|
||||
{
|
||||
cd->error("base class is forward referenced by %s", toChars());
|
||||
cd->semantic(NULL);
|
||||
if (!cd->baseClass)
|
||||
cd->error("base class is forward referenced by %s", toChars());
|
||||
}
|
||||
|
||||
if (this == cd->baseClass)
|
||||
return 1;
|
||||
|
||||
cd = cd->baseClass;
|
||||
}
|
||||
return 0;
|
||||
@@ -876,14 +878,14 @@ Dsymbol *ClassDeclaration::search(Loc loc, Identifier *ident, int flags)
|
||||
Dsymbol *s;
|
||||
//printf("%s.ClassDeclaration::search('%s')\n", toChars(), ident->toChars());
|
||||
|
||||
if (scope)
|
||||
if (scope && !symtab)
|
||||
{ Scope *sc = scope;
|
||||
sc->mustsemantic++;
|
||||
semantic(sc);
|
||||
sc->mustsemantic--;
|
||||
}
|
||||
|
||||
if (!members || !symtab || scope)
|
||||
if (!members || !symtab)
|
||||
{
|
||||
error("is forward referenced when looking for '%s'", ident->toChars());
|
||||
//*(char*)0=0;
|
||||
|
||||
Reference in New Issue
Block a user