Description
Full name of submitter: Brian Bi
Reference (section label): [dcl.init.general]
Issue description: As pointed out on cppreference, the standard appears to say that if any default constructor is user-provided, then value-initialization does not first zero-initialize; but implementations appear to zero-initialize as long as the selected default constructor is not user-provided. I think the latter behavior is probably the intent of the standard.
Suggested resolution: This resolution is relative to the tentatively ready resolution of CWG2820.
Edit [dcl.init.general]/9.1 as follows:
If
T
is a (possibly cv-qualified) class type ([class]), then letC
be the constructor selected to default-initialize an object of typeT
. IfC
is not user-provided, the object is first zero-initialized. Regardless of whether such zero-initialization was performed, the object is then default-initialized.
ifT
has either no default constructor ([class.default.ctor]) or a default constructor that is user-provided or deleted, then the object is default-initialized;otherwise, the object is zero-initialized and then default-initialized.