This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52130] missing check for matching underlying type during instantiation of enum member of class template


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52130

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2017-08-18
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
You can make g++ reject it with -pedantic-errors:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic-errors -std=c++11 52130.cc
52130.cc:2:27: error: ‘enum S<T>::E’ is an enumeration template [-Wpedantic]
 template<typename T> enum S<T>::E : T { e };
                           ^~~~
$

Is that sufficient?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]