Date
2014-05-15.00:00:00
Message id
4890

Content

Proposed resolution (May, 2014):

Change 11.4.5 [class.ctor] paragraphs 4-5 as follows:

A defaulted default constructor for class X is defined as deleted if:

  • ...

  • any potentially constructed subobject has a type with a destructor that is deleted or inaccessible from the defaulted default constructor.

An implicitly-declared default constructor is constexpr if:

  • X has no virtual bases; and

  • for each non-variant non-static data member or base class subobject M, either M is initialized via brace-or-equal-initializer or default-initialization of M uses a constexpr constructor; and

  • if X is a union having variant members, or, if X is a non-union-class, for each anonymous union member having variant members, exactly one non-static data member is initialized via brace-or-equal-initializer.

A default constructor is trivial if it is not user-provided and if:

  • ...

  • for all the non-static data members of its class that are of class type (or array thereof), each such class has a trivial default constructor.

Otherwise, the default constructor is non-trivial.

A default constructor that is defaulted and not defined as deleted is implicitly defined when it is odr-used (6.3 [basic.def.odr]) to create an object of its class type (6.7.2 [intro.object]) or when it is explicitly defaulted after its first declaration. The implicitly-defined default constructor performs the set of initializations of the class that would be performed by a user-written default constructor for that class with no ctor-initializer (11.9.3 [class.base.init]) and an empty compound-statement. If that user-written default constructor would be ill-formed, the program is ill-formed. If that user-written default constructor would satisfy the requirements of a constexpr constructor (9.2.6 [dcl.constexpr]), the implicitly-defined default constructor is constexpr. Before the defaulted default constructor for a class is implicitly defined, all the non-user-provided default constructors for its base classes and its non-static data members shall have been implicitly defined. [Note:...