Bug 1956 – Struct in 'for' statement breaks CTFE

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-03-28T03:33:00Z
Last change time
2015-06-09T01:14:35Z
Keywords
rejects-valid
Assigned to
nobody
Creator
samukha

Comments

Comment #0 by samukha — 2008-03-28T03:33:24Z
Reopens 1363 (I messed up that one by posting two bugs in a single bug report) ---- struct S { int x; } int foo() { S s; for(; s.x < 10; s.x++) { } return s.x; } enum x = foo(); ---- Error: cannot evaluate foo() at compile time (output twice)
Comment #1 by clugdbug — 2009-07-21T06:29:36Z
Works for me (DMD 2.031).