diff --git a/dmd2/expression.c b/dmd2/expression.c index 86f7f5d5..08b76a66 100644 --- a/dmd2/expression.c +++ b/dmd2/expression.c @@ -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) diff --git a/dmd2/expression.h b/dmd2/expression.h index 2bbbc38e..e175b13a 100644 --- a/dmd2/expression.h +++ b/dmd2/expression.h @@ -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); diff --git a/dmd2/mtype.c b/dmd2/mtype.c index 0e2d4afe..4e0bfe4b 100644 --- a/dmd2/mtype.c +++ b/dmd2/mtype.c @@ -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 }