Bug 6919 – [CTFE] Cannot get effect to local variable through its pointer

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-11-09T03:27:00Z
Last change time
2011-11-16T11:54:13Z
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2011-11-09T03:27:55Z
void formattedRead(int* val) { *val = 1; } void test() { int n; formattedRead(&n); assert(n == 1); // fails! } static assert({ test(); return true; }());
Comment #1 by k.hara.pg — 2011-11-09T04:52:09Z
Similar code. void formattedRead(string* val) { *val = "1"; } void test() { string val; formattedRead(&val); assert(val == "1"); } static assert({ test(); return true; }());
Comment #2 by bugzilla — 2011-11-16T11:54:13Z