I maybe asking a dumb question, but I looked at the wikipedia page for RVO here and could not stop wondering if that behavior is wrong. I tried it in my machine and RVO is f
Define "wrong". The C++ language explicitly permits this kind of optimization even though it is observable. If the behavior of your program depends on a specific implementation, then unfortunately you are not using ISO C++, but some dialect.