Removed a hack for bug #218. That fixes many regressions in CTFE

This commit is contained in:
Alexey Prokhin
2010-12-17 12:55:28 +03:00
parent 7e6807b0df
commit c089205395
3 changed files with 1 additions and 10 deletions

View File

@@ -3487,13 +3487,10 @@ int StructLiteralExp::isLvalue()
}
#endif
/*
Removed in LDC. See declaration.
Expression *StructLiteralExp::toLvalue(Scope *sc, Expression *e)
{
return this;
}
*/
int StructLiteralExp::checkSideEffect(int flag)

View File

@@ -551,9 +551,7 @@ struct StructLiteralExp : Expression
Expression *optimize(int result);
Expression *interpret(InterState *istate);
int isLvalue();
// LDC: struct literals aren't lvalues! Taking their address can lead to
// incorrect behavior, see LDC#218, DMD#2682
// Expression *toLvalue(Scope *sc, Expression *e);
Expression *toLvalue(Scope *sc, Expression *e);
int canThrow();
MATCH implicitConvTo(Type *t);

View File

@@ -7229,9 +7229,6 @@ Expression *TypeStruct::defaultInitLiteral(Loc loc)
#if LOGDEFAULTINIT
printf("TypeStruct::defaultInitLiteral() '%s'\n", toChars());
#endif
#if IN_LLVM
return defaultInit(loc);
#else
if (sym->isNested())
return defaultInit(loc);
Expressions *structelems = new Expressions();
@@ -7251,7 +7248,6 @@ Expression *TypeStruct::defaultInitLiteral(Loc loc)
// sym->type != NULL ?
structinit->type = sym->type;
return structinit;
#endif
}