Title
underlying_type doesn't say what to do for an incomplete enumeration type
Status
c++17
Section
[meta.trans.other]
Submitter
Richard Smith

Created on 2014-06-12.00:00:00 last changed 81 months ago

Messages

Date: 2014-06-16.23:41:12

Proposed resolution:

This wording is relative to N3936.

  1. Change Table 57 — "Other transformations" as indicated:

    Table 3 — Other type transformations
    Template Condition Comments
    template <class T>
    struct underlying_type;
    T shall be a complete an enumeration type (7.2) […]
Date: 2014-06-16.00:00:00

[ 2014-06-16 Rapperswil ]

Move to Ready

Date: 2014-06-12.00:00:00

Consider:

enum E {
  e = std::underlying_type<E>::type(1)
};

Clearly this should be ill-formed, but the library section doesn't appear to ban it. Suggestion:

Change in [meta.trans.other] Table 57:

Template: template<class T> struct underlying_type;

Condition: T shall be a complete an enumeration type (7.2)

Comments: […]

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2014-11-08 19:44:42adminsetstatus: voting -> wp
2014-11-04 10:26:50adminsetstatus: ready -> voting
2014-06-16 23:41:12adminsetmessages: + msg7051
2014-06-16 23:41:12adminsetstatus: new -> ready
2014-06-12 18:42:06adminsetmessages: + msg7023
2014-06-12 00:00:00admincreate