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);
@MoonlightSentinel created dlang/dmd pull request #10550 "Fix Issue 20375 - RefCounted does not work with checkaction-context" fixing this issue: - Fix Issue 20375 - std.typecons.RefCounted does not work with checkaction-context https://github.com/dlang/dmd/pull/10550
dlang/dmd pull request #10550 "Fix Issue 20375 - RefCounted does not work with checkaction-context" was merged into master: - 32485b35c929ea49a7e0785b83297669ce81cde9 by MoonlightSentinel: Fix Issue 20375 - std.typecons.RefCounted does not work with checkaction-context https://github.com/dlang/dmd/pull/10550