Thread overview | |||||
---|---|---|---|---|---|
|
July 06, 2011 [Issue 6257] New: Struct postblit not called in one case | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6257 Summary: Struct postblit not called in one case Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2011-07-06 03:27:03 PDT --- With DMD 2.053 the second assert of this program fires, is this a DMD bug? struct Foo { int[] data; this(int n) { data.length = n; } this(this) { data = data.dup; } } void main() { Foo f1, f2; f1 = Foo(1); f2 = f1; assert(f1.data.ptr != f2.data.ptr); // OK f1 = f2 = Foo(1); assert(f1.data.ptr != f2.data.ptr); // asserts } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 11, 2012 [Issue 6257] Struct postblit not called in one case | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6257 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-10 19:52:21 PDT --- The bug mechanism is: struct Foo { int[] data; this(int n) { data.length = n; } this(this) { data = data.dup; } // Implicitly generated by compiler ref Foo opAssign(Foo rhs) { ... } } void main() { ... f1 = f2 = Foo(1); // is translated to: f1.opAssign(f2.opAssign(Foo(1))); // f2.opAssign returns ref Foo } "Postblit not called on ref returned object" is same as bug 6119. Then, this was a dup of it. *** This issue has been marked as a duplicate of issue 6119 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 11, 2012 [Issue 6257] Struct postblit not called in one case | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=6257 --- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-10 19:53:28 PDT --- Sorry, I missed. This is a dup of bug 6199. *** This issue has been marked as a duplicate of issue 6199 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation