mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Merged DMD commit ac685a4b2ec07af83f687f41496e3af02e3f0fe:
bugzilla 190 and 4753
This commit is contained in:
@@ -3994,6 +3994,9 @@ Expression *VarExp::semantic(Scope *sc)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (type && !type->deco)
|
||||
type = type->semantic(loc, sc);
|
||||
|
||||
/* Fix for 1161 doesn't work because it causes protection
|
||||
* problems when instantiating imported templates passing private
|
||||
* variables as alias template parameters.
|
||||
@@ -5562,7 +5565,8 @@ Expression *DotIdExp::semantic(Scope *sc)
|
||||
e->type = v->type;
|
||||
}
|
||||
}
|
||||
return e->deref();
|
||||
e = e->deref();
|
||||
return e->semantic(sc);
|
||||
}
|
||||
|
||||
FuncDeclaration *f = s->isFuncDeclaration();
|
||||
|
||||
10
dmd/mtype.c
10
dmd/mtype.c
@@ -3935,6 +3935,7 @@ TypeTypeof::TypeTypeof(Loc loc, Expression *exp)
|
||||
: TypeQualified(Ttypeof, loc)
|
||||
{
|
||||
this->exp = exp;
|
||||
inuse = 0;
|
||||
}
|
||||
|
||||
Type *TypeTypeof::syntaxCopy()
|
||||
@@ -3981,6 +3982,13 @@ Type *TypeTypeof::semantic(Loc loc, Scope *sc)
|
||||
//printf("TypeTypeof::semantic() %p\n", this);
|
||||
|
||||
//static int nest; if (++nest == 50) *(char*)0=0;
|
||||
if (inuse)
|
||||
{
|
||||
inuse = 2;
|
||||
error(loc, "circular typeof definition");
|
||||
return Type::terror;
|
||||
}
|
||||
inuse++;
|
||||
|
||||
#if 0
|
||||
/* Special case for typeof(this) and typeof(super) since both
|
||||
@@ -4077,9 +4085,11 @@ Type *TypeTypeof::semantic(Loc loc, Scope *sc)
|
||||
goto Lerr;
|
||||
}
|
||||
}
|
||||
inuse--;
|
||||
return t;
|
||||
|
||||
Lerr:
|
||||
inuse--;
|
||||
return terror;
|
||||
}
|
||||
|
||||
|
||||
@@ -597,6 +597,7 @@ struct TypeInstance : TypeQualified
|
||||
struct TypeTypeof : TypeQualified
|
||||
{
|
||||
Expression *exp;
|
||||
int inuse;
|
||||
|
||||
TypeTypeof(Loc loc, Expression *exp);
|
||||
Type *syntaxCopy();
|
||||
|
||||
Reference in New Issue
Block a user