根据 C++11 标准,§12.8.31:
…This elision of copy/move operations, called copy elision, is permitted in the following circumstances (which may be combined to eliminate multiple copies):
…</p>
- when a temporary class object that has not been bound to a reference would be copied/moved to a class object with the same cv-unqualified type, the copy/move operation can be omitted by constructing the temporary object directly into the target of the omitted copy/move
Temporary objects get a lot of leeway in C++, and compilers will be pretty aggressive when removing them. If your object had a lifetime of its own in any way, then the copy constructor would end up being called.
However, I would definitely expect it to check the copy constructor's access modifier, though I can see an argument that you shouldn't (after all, you just aren't calling the copy constructor). But that probably wouldn't be very good practice, since copy elision is optional.