[Issue 7940] CTFE wrong-code for opAssign and std.array.Appender
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 26 23:40:26 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7940
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |CTFE, wrong-code
CC| |clugdbug at yahoo.com.au
Summary|CTFE breaks |CTFE wrong-code for
| |opAssign and
| |std.array.Appender
--- Comment #2 from Don <clugdbug at 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: -------
More information about the Digitalmars-d-bugs
mailing list