After Alexander's commit (r253295) I see: $ cat ice.cpp template <typename T> struct A { enum E : T; void h (); }; template <typename T> enum A<T>::E : T { e1, e2 }; template <> enum A<long long>::E : long long {}; template <typename T> struct C { enum class E : T; }; C<int>::E c3 = C<int>::E::e6; $ g++-7 ice.cpp ice.cpp:12:27: error: ‘e6’ is not a member of ‘C<int>::E’ C<int>::E c3 = C<int>::E::e6; ^~ $ g++-trunk ice.cpp ice.cpp:7:47: error: qsort comparator non-negative on sorted output: 1 template <> enum A<long long>::E : long long {}; ^ ice.cpp:7:47: internal compiler error: qsort checking failed 0x5ee434 qsort_chk_error .././../gcc/vec.c:222 0x16207c5 qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*, void const*)) .././../gcc/vec.c:274 0x7287ef insert_late_enum_def_bindings(tree_node*, tree_node*) .././../gcc/cp/name-lookup.c:1727 0x6923d1 finish_enum_value_list(tree_node*) .././../gcc/cp/decl.c:14322 0x76058c cp_parser_enum_specifier .././../gcc/cp/parser.c:18222 0x76058c cp_parser_type_specifier .././../gcc/cp/parser.c:16644 0x76e156 cp_parser_decl_specifier_seq .././../gcc/cp/parser.c:13568 0x773355 cp_parser_single_declaration .././../gcc/cp/parser.c:26972 0x774467 cp_parser_explicit_specialization .././../gcc/cp/parser.c:16564 0x77a426 cp_parser_declaration .././../gcc/cp/parser.c:12669 0x77a6eb cp_parser_declaration_seq_opt .././../gcc/cp/parser.c:12599 0x77a9fa cp_parser_translation_unit .././../gcc/cp/parser.c:4390 0x77a9fa c_parse_file() .././../gcc/cp/parser.c:38907 0x8c0df6 c_common_parse_file() .././../gcc/c-family/c-opts.c:1113
Created attachment 42683 [details] gcc8-pr82401.patch Untested fix.
Author: jakub Date: Wed Nov 22 22:35:52 2017 New Revision: 255084 URL: https://gcc.gnu.org/viewcvs?rev=255084&root=gcc&view=rev Log: PR c++/82401 * name-lookup.c (member_name_cmp): Return 0 if a == b. * g++.dg/cpp0x/pr82401.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp0x/pr82401.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/name-lookup.c trunk/gcc/testsuite/ChangeLog
Fixed.