It is implementation-defined behaviour whether the reference parameter is a temporary object or a reference to the parameter. If the implementation uses a local copy (temporary object), this will be destroyed when the function returns. Any attempt to use such an object after its destruction will lead to undefined behaviour.
* I think you missed the mark on the message. The title makes clear that the param being returned was initially received as a reference, so advice to refactor to a reference param doesn't make a lot of sense to me. Instead, I'd advise switching to a ``++void++`` return.