c++ 禁用g的返回值优化

在命令行上需要什么标志来禁用g编译器自动启用的返回值优化?
-fno-elide-构造函数

The C++ standard allows an implementation to omit creating a temporary which is only used to initialize another object of the same type. Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases. [Source: man gcc]

相关文章
相关标签/搜索