[Issue 23164] [REG 2.097] Infinite loop on assertion failure + DMD moves struct with copy constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 8 02:30:15 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23164

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
I find the `auto ref` parameter suspicious. What are you expecting to happen
there? Do you expect it to be passed by ref or by value? It doesn't compile
with making it just `ref`, so simply removing `auto ref` produces the same
result (infinite loop assert in the destructor).

But, passing it by value means another constructor call, and another destructor
call.

I'm not sure what you're expecting to happen here. I suspect the problem is
with the `auto ref`. Copy constructors should be passing their rvalue by ref,
amirite?

--


More information about the Digitalmars-d-bugs mailing list