Well, it cannot elide a copy constructor invocation if the copy constructor is not to be invoked in the first place. So, it notes that pass by value is used, hence a copy constructor should be invoked. Now, based on other factors, e.g., the fact that the function call involves a temporary object being created and then immediately copied, it decides that the copying is actually unnecessary. Therefore, instead of copying the temporary object, it treats it as if the temporary object and the object in the function are one and the same. Thus, all it needs to do is generate the code to create the object (hence the Dog(int, int) constructor call), but can elide the code to copy it (hence no copy constructor call).Originally Posted by Eman