[Issue 8475] New: postblits fails attributes qualifying when in a template.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 30 14:09:07 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8475

           Summary: postblits fails attributes qualifying when in a
                    template.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rtcvb32 at yahoo.com


--- Comment #0 from Era Scarecrow <rtcvb32 at yahoo.com> 2012-07-30 14:09:06 PDT ---
T func2(T)(T x) @safe pure {
  return T();
}

struct XY {
  this(this) @safe pure {} //safe pure added so func can call it, shows bug
  void func(XY x) @safe pure {
    XY y = x;
    func2(x);
    func2(y);
  }
}

template X(bool something) {
struct XY {
    this(this) @safe pure {}
    void func(XY x) @safe pure {
      XY y = x; //Error: see below
      func2(x);
      func2(y);
    }
  }
}

alias X!(true).XY Xtrue;


produces:
pure function 'func' cannot call impure function '__cpctor'
safe function 'func' cannot call system function '__cpctor'

if func2 is writeln() they too will complain about the postblits being
impure/system during the copy step, along with writeln being impure.

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


More information about the Digitalmars-d-bugs mailing list