Summary: Copy constructor not called under extremely mysterious
--- Comment #0 from Andrei Alexandrescu <and...@metalanguage.com> 2010-06-20
20:40:18 PDT ---
I spent the better part of today trying to escape this elusive bug. It's
extremely subtle because it depends on some unrelated code existing or not.
Here it is:
writeln("I was copied");
auto another = this;
auto a = A(4);
auto b = a.copy();
writefln("a: %p, b: %p\n", &a, &b);
At the end of this program the writefln witnesses that we have two objects, but
the stdout is mute so the subobject was not copied.
Changing some code in the example above makes the example work. For example,
replacing A(4) with A() produces a correct program.
Please give this priority (as all ctor/dtor bugs should have). Thanks.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------