comparison dmd/expression.h @ 1168:ab186e535e72

A different fix to #218 and DMD2682 that does not lead to constant folding regressions. Fixes run/const_15, run/c/const_16_B. The price is removing the lvalueness of struct literals. If it turns out too much code depends on this behavior or we don't want to break with DMD, we could keep struct literals as lvalues and instead convert struct literals used as expression initializers into struct initializers.
author Christian Kamm <kamm incasoftware de>
date Sun, 29 Mar 2009 11:43:45 +0200
parents 521dd1626d76
children e961851fb8be
comparison
equal deleted inserted replaced
1164:166042b48c28 1168:ab186e535e72
500 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 500 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
501 void toMangleBuffer(OutBuffer *buf); 501 void toMangleBuffer(OutBuffer *buf);
502 void scanForNestedRef(Scope *sc); 502 void scanForNestedRef(Scope *sc);
503 Expression *optimize(int result); 503 Expression *optimize(int result);
504 Expression *interpret(InterState *istate); 504 Expression *interpret(InterState *istate);
505 Expression *toLvalue(Scope *sc, Expression *e); 505 // LDC: struct literals aren't lvalues! Taking their address can lead to
506 // incorrect behavior, see LDC#218, DMD#2682
507 // Expression *toLvalue(Scope *sc, Expression *e);
506 508
507 int inlineCost(InlineCostState *ics); 509 int inlineCost(InlineCostState *ics);
508 Expression *doInline(InlineDoState *ids); 510 Expression *doInline(InlineDoState *ids);
509 Expression *inlineScan(InlineScanState *iss); 511 Expression *inlineScan(InlineScanState *iss);
510 512