www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10968] New: array copy "1-to-N" by-passes "this(this) disable"

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

           Summary: array copy "1-to-N" by-passes "this(this)  disable"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com



For either static or dynamic

//----
struct S
{
    this(this)  disable;
}

void main()
{
    S s;
    S[1] ss = s; //Passes, should fail
    ss = s;      //Passes, should fail
    ss[] = s;    //Passes, should fail
    ss = ss;     //Correctly fails
    ss[] = ss[]; //Correctly fails
    S s2 = s;    //Correctly fails
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10968


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, pull
            Summary|array copy "1-to-N"         |array element copy (1-N and
                   |by-passes "this(this)       |N-N) ignores postblit
                   | disable"                   |attributes



 safe/pure/nothrow attributes also be ignored wrongly.

struct SA
{
    this(this)
    {
        throw new Exception("BOOM!");
    }
}

void main() pure  safe nothrow
{
    SA    ss;
    SA[1] sa;

    // TOKassign
    ss = ss;    // correctly fails
    sa = ss;    // no error
    sa = sa;    // no error

    // TOKconstruct
    SA    ss2 = ss;     // correctly fails
    SA[1] sa2 = ss;     // no error
    SA[1] sa3 = sa;     // no error
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10968




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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10968




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

https://github.com/D-Programming-Language/dmd/commit/3a7af238036811bd8366828c2fef756e54118a87
Issue 10968 - array element copy (1-N and N-N) ignores postblit attributes

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10968


Kenji Hara <k.hara.pg gmail.com> 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: -------
Sep 08 2013