Title
Constraints on literal unions
Status
cd4
Section
6.8 [basic.types]
Submitter
Agustín K-ballo Bergé

Created on 2015-03-11.00:00:00 last changed 94 months ago

Messages

Date: 2015-09-15.00:00:00

Proposed resolution (September, 2015):

Change 6.8 [basic.types] bullet 10.5 as follows:

A type is a literal type if it is:

  • ...

  • a possibly cv-qualified class type (Clause 11 [class]) that has all of the following properties:

    • it has a trivial destructor,

    • it is an aggregate type (9.4.2 [dcl.init.aggr]) or has at least one constexpr constructor or constructor template that is not a copy or move constructor, and

    • if it is a union, at least one of its non-static data members is of non-volatile literal type, and

    • if it is not a union, all of its non-static data members and base classes are of non-volatile literal types.

Date: 2016-02-15.00:00:00

[Adopted at the February, 2016 meeting.]

According to 6.8 [basic.types] bullet 10.5.3, all the members of a class type must be of non-volatile literal types. This seems overly constraining for unions; it would seem to be sufficient if at least one of its non-static members were of a literal type.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: tentatively ready -> cd4
2015-11-10 00:00:00adminsetmessages: + msg5592
2015-11-10 00:00:00adminsetstatus: drafting -> tentatively ready
2015-03-11 00:00:00admincreate