struct Foo { int a; } void modify(ref Foo foo) { foo.a++; } void main() { modify(Foo(1)); } Why compiler doesn't report error? So as struct literal "Foo()" isn't a lvalue, it's impossible to pass it by reference. Isn't it? Just like string or numeric literals.