There is nothing wrong with the original code. A reference can bind to an object.
(And in fact, no expression ever has a reference type. Expressions can be lvalues, xvalues, or prvalues, and commandName
here is an lvalue, so an lvalue reference can bind to it.)