你在讲什么?constructor的return是void哪有什么回传function return都是rvalue 建构子也是我终于看懂你的问题了......因为你的g不是回传reference type当然不会动到reference的constructor阿......你的问题是连最基本的三种呼叫和回传都没搞懂call by value, call by address,call by reference
所以是RVO关不掉?RVO是c++11的standard名称是copy elision我把原PO的code改了一下 http://cpp.sh/4u43728行VS报错内容'return': cannot convert from 'myClass' to 'myClass &&'Clang报错内容rvalue reference to type 'myClass' cannot bind to lvalue of type 'myClass'