This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Moved to DR at the April, 2013 meeting.]
According to 9.4 [dcl.init] paragraph 7, a trivial default constructor is not used in value initialization, so the following example would appear to be well-formed:
struct A { private: A() = default; }; int main() { A(); }
Proposed resolution (February, 2013):
Change 9.4 [dcl.init] paragraph 7 as follows:
To default-initialize an object of type T means:
if T is a (possibly cv-qualified) class type ( Clause 11 [class]), the default constructor (11.4.5 [class.ctor]) for T is called (and the initialization is ill-formed if T has no
accessible default constructordefault constructor or overload resolution (12.2 [over.match]) results in an ambiguity or in a function that is deleted or inaccessible from the context of the initialization);...
Change 9.4 [dcl.init] paragraph 8 as follows:
To value-initialize an object of type T means:
...
if T is a (possibly cv-qualified) non-union class type without a user-provided or deleted default constructor, then the object is zero-initialized and the semantic constraints for default-initialization are checked, and if T has a non-trivial default constructor, the object is default-initialized;
...