www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20767] New: [DIP1014] __move_post_blt must only recursively

https://issues.dlang.org/show_bug.cgi?id=20767

          Issue ID: 20767
           Summary: [DIP1014] __move_post_blt must only recursively call
                    itself on a struct's fields not all members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

Example of current erroneous behavior:

---
void main()
{
    static struct DoNotMove
    {
        bool movedInto;
        void opPostMove(const ref DoNotMove oldLocation)
        {
            movedInto = true;
        }
    }
    static DoNotMove doNotMove;

    struct A
    {
         property ref DoNotMove member()
        {
            return doNotMove;
        }
    }
    A src, dest;
    __move_post_blt(dest, src);
    assert(!doNotMove.movedInto); // This currently fails.
}
---

--
Apr 26 2020