> The issue is this isn't returning some value,
> it's returning a reference to an instance of a string class who's scope has terminated.
It is returning a prvalue (which has a result object of type std::string)
Without copy elision, the return statement would have involved making a copy of the local string str (move construction of the temporary); this copy/move operation is sequenced before the destruction of str.
n3055 is pre-C++17. C++17 further refined the notion of prvalue expressions.
In order to enable guaranteed copy elision, C++17 makes a distinction between prvalue expressions and the temporary result objects initialized by them.