Title
Incorrect example of explicit specialization of member enumeration
Status
nad
Section
13.9.4 [temp.expl.spec]
Submitter
John Spicer

Created on 2013-10-01.00:00:00 last changed 131 months ago

Messages

Date: 2014-02-15.00:00:00

Rationale (February, 2014):

The problem was fixed editorially in N3797.

Date: 2022-11-20.07:54:16

The example in 13.9.4 [temp.expl.spec] paragraph 6 reads, in part,

  template<class T> struct A {
    enum E : T;
    enum class S : T;
  };
  template<> enum A<int>::E : int { eint };         // OK
  template<> enum class A<int>::S : int { sint };   // OK
  template<class T> enum A<T>::E : T { eT };
  template<class T> enum class A<T>::S : T { sT };
  template<> enum A<char>::E : int { echar };       // ill-formed, A<char>::E was instantiated
                                                    // when A<char> was instantiated
  template<> enum class A<char>::S : int { schar }; // OK

The int enum-base in the last two lines appears to be incorrect; the reference to A<char> in the nested-name-specifier will have instantiated the declarations of E and S with an enum-base of char, and the explicit specializations must agree.

History
Date User Action Args
2014-03-03 00:00:00adminsetmessages: + msg4983
2014-03-03 00:00:00adminsetstatus: open -> nad
2013-10-01 00:00:00admincreate