FName - Pass by value or pass by reference

If you’re seeing that sort of behavior then it’s more likely due to your own use of the reference (or the source of the reference) then the actual pass-by-reference behavior. The behavior will be no different than if you make a reference as a local variable and then do something to the source variable. And it would also be true for any reference type, not just references to FNames.

You absolutely have to be careful about using references to instances of things in containers. Any operation that modifies the container (especially adds, resizes or reserves) may cause the container to reallocate and move the contents to other memory. This will invalidate any references you have to things stored in the container.