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

2024-04-18


646. Can a class with a constexpr copy constructor be a literal type?

Section: 6.8  [basic.types]     Status: NAD     Submitter: Jens Maurer     Date: 9 Aug 2007

6.8 [basic.types] paragraph 11 requires that a class type have a trivial copy constructor in order to be classified as a literal type. This seems overly restrictive; presumably having a constexpr copy constructor would suffice. (Note that a trivial copy constructor is a constexpr constructor according to 9.2.6 [dcl.constexpr] paragraph 4.)

Rationale (June, 2008):

A copy constructor takes a reference as its first parameter, thus no user-declared copy constructor can be constexpr.