@@ -142,7 +142,8 @@ Expression implicitCastTo(Expression e, Scope* sc, Type t)
142
142
if (ad) {
143
143
import dmd.identifier;
144
144
import dmd.id;
145
- auto tmp = new VarDeclaration(e.loc, t, Identifier.generateId(" __ictorcmp" ), null );
145
+ auto tmp = new VarDeclaration(e.loc, t, Identifier.generateId(" __ictorcmp" ), new ExpInitializer(e.loc, e));
146
+ tmp.storage_class = STC .rvalue | STC .temp | STC .ctfe;
146
147
tmp.dsymbolSemantic(sc);
147
148
148
149
Expression decl = new DeclarationExp(e.loc, tmp);
@@ -153,11 +154,13 @@ Expression implicitCastTo(Expression e, Scope* sc, Type t)
153
154
auto ce = new CallExp(e.loc, e2, e);
154
155
e2 = ce;
155
156
156
- auto declareTmps = new CommaExp(e.loc, decl, e2);
157
+ // auto declareTmps = new CommaExp(e.loc, decl, e2);
157
158
158
159
if (sc && .trySemantic(e2, sc)) {
159
160
if (hasImplicitAttr(ce.f)) {
160
- result = declareTmps.expressionSemantic(sc);
161
+ // printf("implicit construction of %s @ %s\n", declareTmps.toChars(), e.loc.toChars());
162
+ // printf("implicit construction of %s @ %s\n", decl.toChars(), e.loc.toChars());
163
+ result = decl.expressionSemantic(sc);
161
164
// printf("implicit construction of %s @ %s\n", t.toChars(), e.loc.toChars());
162
165
return result;
163
166
}
0 commit comments