www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7785] New: [CTFE] ICE when slicing pointer to variable

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

           Summary: [CTFE] ICE when slicing pointer to variable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



cat > bug.d << CODE
bool foo()
{
    int val;
    auto p = &val;
    auto ary = p[0 .. 1];
    return true;
}

enum res = foo();
CODE

dmd -c bug

--------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7785


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE, pull
                 CC|                            |clugdbug yahoo.com.au



It also applies to indexing, and assignment to slices and indices:


    int val = 7;
    auto p = &val;
    auto ary = p[0 .. 1]; // ICE 1
    auto x = p[0];        // ICE 2
    p[0..1] = 1;          // ICE 3
    p[0] = 6;             // ICE 4

This pull request turns ICE 1 and ICE 3 into sensible error messages;
ICE 2 compiles without error (it only generates an error, if index is non-zero)
ICE 4 generates a "not yet implemented" error.

https://github.com/D-Programming-Language/dmd/pull/851

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 30 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7785




Commit pushed to master at https://github.com/D-Programming-Language/dmd

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


Fix issue 7785 [CTFE] ICE when slicing pointer to variable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 30 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7785


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2012