[Issue 15869] RVO can overwrite argument
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Apr 5 13:29:42 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15869
--- Comment #3 from ag0aep6g at gmail.com ---
(In reply to Yuxuan Shui from comment #2)
> I think the expected behavior here is a compile error.
I think it should compile and set xx.a.value to 1. The compiler manages to do
that when `a = clobber(&a);` is done outside of the constructor, and I don't
see a reason why it being in a constructor should make a difference.
--
More information about the Digitalmars-d-bugs
mailing list