You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 let C be the constructor selected to default-initialize an object of type T. If C is not user-provided, the object is first zero-initialized. Regardless of whether such zero-initialization was performed, the object is then default-initialized.
if T 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.