digitalmars.D.bugs - [Issue 20375] New: std.typecons.RefCounted does not work with
- d-bugmail puremagic.com (43/43) Nov 09 2019 https://issues.dlang.org/show_bug.cgi?id=20375
https://issues.dlang.org/show_bug.cgi?id=20375 Issue ID: 20375 Summary: std.typecons.RefCounted does not work with checkaction-context Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: moonlightsentinel disroot.org Using checkation=context results in another temporary which gets destroyed but not constructed by any declared constructor. Reduced test case: struct RefCounted { static int instances; this(bool data) { instances++; } this(this) { instances++; } ~this() { instances--; } bool opEquals(RefCounted) { return true; } } { auto a = RefCounted(true); assert(a == a); } assert(RefCounted.instances == 0); --
Nov 09 2019