D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6721 - [CTFE] Cannot get pointer to start of char[]
Summary: [CTFE] Cannot get pointer to start of char[]
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-23 12:50 UTC by timon.gehr
Modified: 2011-09-26 23:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2011-09-23 12:50:38 UTC
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*