Bug 14371 – [CTFE] Binary assignment expression makes wrong result in compile-time
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-29T03:44:00Z
Last change time
2015-06-17T21:03:55Z
Keywords
CTFE, pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2015-03-29T03:44:54Z
Test case:
int ctfetest()
{
int x;
++(x += 1);
return x == 2;
}
void main()
{
enum v = ctfetest();
assert(v == ctfetest()); // should be ok, but doesn't
}