When a function is passed with a parameter, local variable is created corresponding to the parameter and is copied with the argument passed on to the function invocation. Hence when the function is invoked, copy constructor of the function will be invoked to copy the argument passed to the invocation to the local variable created. This results in a endless loop.
Where as when a reference is passed on to the function , local variable is not created corresponding to the parameter.