Victor said:
What you know is wrong. Read 8.5/14. Nowhere in that paragraph does
the Standard say anything specific to POD for copy-initialisation. Your
knowledge apparently is about a _possible_ short-cut the compiler is
allowed to take based on 12.8/15.
8.5//5 says:
"To value-initialize an object of type T means:
— if T is a class type (clause 9) with a user-declared constructor
(12.1), then the default constructor for T is called (and the
initialization is ill-formed if T has no accessible default constructor);
— if T is a non-union class type without a user-declared constructor,
then every non-static data member and base-class component of T is
value-initialized;
— if T is an array type, then each element is value-initialized;
— otherwise, the object is zero-initialized"
8.5//7:
"An object whose initializer is an empty set of parentheses, i.e., (),
shall be value-initialized."
That means that a POD:
T x = T();
is "zero-initialized".
Zero-initialized doesn't mean a temporary is created and copied with the
copy constructor. but initialised to 0 directly.