This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


1198. Literal types and copy constructors

Section: 6.8  [basic.types]     Status: C++11     Submitter: Jason Merrill     Date: 2010-09-16

[Voted into the WP at the March, 2011 meeting.]

According to 6.8 [basic.types] paragraph 10, a literal class type has

Is this intended to mean that

    struct A {
       A(const A&) = default;
       A(A&);
    };

is a literal class because it does have a trivial copy constructor even though it also has a non-trivial one? That seems inconsistent with the prohibition of non-trivial move constructors.

My preference would be to resolve this inconsistency by dropping the restriction on non-trivial move constructors. It seems to me that having a trivial copy or move constructor is sufficient, we don't need to prohibit additional non-trivial ones. Actually, it's not clear to me that we need the first condition either; a literal type could be used for singleton variables even if it can't be copied.

Proposed resolution (November, 2010):

This issue is resolved by the resolution of issue 981.