www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8475] New: postblits fails attributes qualifying when in a template.

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: rtcvb32 yahoo.com



---
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: -------
Jul 30 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8475


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



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

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




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

https://github.com/D-Programming-Language/dmd/commit/3e171f435d2761489818c83b0bda305a158a353a
fix Issue 8475 - postblits fails attributes qualifying when in a template.

In PostBlitDeclaration::syntaxCopy, storage_class should also be copied to new
AST object.
It's a design failure of the signature in PostBlitDeclaration constructor, so
merge two constructors into one.

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


Issue 8475 - postblits fails attributes qualifying when in a template.

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


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |braddr puremagic.com
         Resolution|                            |FIXED


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