I am sure this bug has been filed, but it doesn't have the right keywords so I couldn't find it. If anyone does, please make that a dupe of this. struct abc { ref abc opAssign(ref abc rhs) { writeln("opAssign"); return this; } } void main(string[] argv) { abc x; x= abc(); } The code shouldn't compile. I fished this one from a lost email from June 6, 2010.
Current dmd implementation marks struct literal and construction as lvalue. *** This issue has been marked as a duplicate of issue 5889 ***