www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6721] New: [CTFE] Cannot get pointer to start of char[]

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6721

           Summary: [CTFE] Cannot get pointer to start of char[]
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



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*

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 23 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6721


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



23:08:15 PDT ---
https://github.com/D-Programming-Language/dmd/commit/a48007b702870dc7f5915f8aea18f3dc3423d8f3

https://github.com/D-Programming-Language/dmd/commit/9830a15fc2873cb36a6d64980aa018ff98b7c0a7

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 26 2011