Bug 6721 – [CTFE] Cannot get pointer to start of char[]
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-09-23T12:50:00Z
Last change time
2011-09-26T23:08:15Z
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2011-09-23T12:50:38Z
Tested with DMD 2.055
void main() {
enum foo={
char[] c="".dup; // works without initialization
// string c=""; // same with this
// ubyte[] c=[]; // fine
auto p = c.ptr; // error here
return 0;
}();
}
Error: CTFE error: cannot cast cast(char*)c to type char*