mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
Removed a hack for bug #218. That fixes many regressions in CTFE
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user