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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE, wrong-code
                 CC|                            |clugd...@yahoo.com.au
            Summary|CTFE breaks                 |CTFE wrong-code for
                   |                            |opAssign and
                   |                            |std.array.Appender


--- Comment #2 from Don <clugd...@yahoo.com.au> 2012-06-26 23:42:55 PDT ---
Could be a CTFE compiler bug, but more likely to
be a bug in the if (__ctfe) code in std.array.Appender.
I don't trust array.Appender anyway. I see no reason for it not be @safe.
It shouldn't be using pointers at all.

Reduced test case:
-----------------
import std.array     : appender;

struct Bug7940 {
    int field0;

    void opAssign(Bug7940 rhs) {
        field0 = rhs.field0;
    }
}

Bug7940[] gen() {
  alias Bug7940 T;
  auto app = appender!(T[]);
  app.put(T(12));
  assert(app.data[0].field0 == 12);
  return app.data;
}

void main() {
  static const ww = gen();
}

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

Reply via email to