This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

### 2396. `underlying_type` doesn't say what to do for an incomplete enumeration type

Section: 20.15.8.7 [meta.trans.other] Status: C++17 Submitter: Richard Smith Opened: 2014-06-12 Last modified: 2017-07-30

Priority: 0

View all other issues in [meta.trans.other].

View all issues with C++17 status.

Discussion:

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 20.15.8.7 [meta.trans.other] Table 57:

> Template: `template<class T> struct underlying_type;`

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

> Comments: […]

[2014-06-16 Rapperswil]

Move to Ready

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) | […]