I was kind of expecting you to watch that short example and understand the problem but I realize it relies quite heavily on things mentioned earlier.
The problem isn't where it stores the memory it's that it's stored. It's difficult to say meaningfull things about any program but most of the time you'll find that the compiler is better at avoiding copies (ignoring copy construction for simplicity, they can be arbitrarily crazy of course) than removing a reference.
Of course I doubt the example he showed first (in the video) would actually be a problem. It's more an example of the principle. The more complex the code gets the more difficult the problem becomes. The more likely the compiler is to not help you make your code fast in the case where you use the reference.
Now if you mean 'locally allocated' by using some construct of your own that does stack allocation that the compiler doesn't figure out (or worse, you do heap allocations and consider it 'local') you've basically engineered your code to have these issues.
Now to your actual question, sorry. I don't know if compilers manage you your case well. It's an unnecessary step because you've just done pass by value except you've given a reference at first to confuse it. I don't dare guess on the actual results but I think you see too how it's pointless.
Its certainly not better than just passing by value. But it may be better than references.