Why this warning from IBM XL C/C++ compiler?
问题 Here's a minimum code example that illustrates the problem: #include <iostream> class Thing { // Non-copyable Thing(const Thing&); Thing& operator=(const Thing&); int n_; public: Thing(int n) : n_(n) {} int getValue() const { return n_;} }; void show(const Thing& t) { std::cout << t.getValue() << std::endl; } int main() { show(3); } This yields the same error: int main() { show( Thing(3) ); } IBM XL C/C++ 8.0 compiler under AIX emits these warnings: "testWarning.cpp", line 24.9: 1540-0306 (W)