Bug 3900 – CTFE: Wrong return value for array.var assignment

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Windows
Creation time
2010-03-08T11:21:00Z
Last change time
2014-04-18T09:12:03Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2010-03-08T11:21:11Z
struct ArrayRet{ int x; } int arrayRetTest(int z) { ArrayRet[6] w; int q = (w[3].x = z); return q; } static assert(arrayRetTest(51)==51); ============== bug.d(23): Error: static assert ([(ArrayRet(0)),(ArrayRet(0)),(ArrayRet(0)),(A rrayRet(51)),(ArrayRet(0)),(ArrayRet(0))] == 51) is not evaluatable at compile t ime
Comment #1 by clugdbug — 2010-03-08T11:33:36Z
Patched in bug 3901.
Comment #2 by clugdbug — 2010-04-09T19:14:05Z
Fixed DMD1.058 and DMD2.042.