https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81899
Bug ID: 81899 Summary: [8 Regression] ICE: Segmentation fault Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org Target Milestone: --- % cat auto_switch_lexerstate.ii template <int> struct bool_; template <typename = bool_<0>> struct token; template <typename, template <typename, typename, typename, typename> class FunctorData, typename> struct functor { friend FunctorData<int, int, int, int>; void foo(); }; template <typename, typename, typename, typename> struct data; template<> void functor<token<>, data, bool_<0>>::foo(); % g++ -c auto_switch_lexerstate.ii auto_switch_lexerstate.ii: In instantiation of ‘struct functor<token<>, data, bool_<0> >’: auto_switch_lexerstate.ii:11:49: required from here auto_switch_lexerstate.ii:6:16: internal compiler error: Segmentation fault struct functor { ^ 0x10ba3023 crash_signal ../../gcc/gcc/toplev.c:341 0x1044d53c instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:10727 0x1044d53c instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:10892 0x104c1ceb complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:136 0x103a69e7 cp_parser_nested_name_specifier_opt ../../gcc/gcc/cp/parser.c:6269 0x103a7833 cp_parser_nested_name_specifier ../../gcc/gcc/cp/parser.c:6332 0x103a794b cp_parser_ptr_operator ../../gcc/gcc/cp/parser.c:20451 0x103aac0b cp_parser_declarator ../../gcc/gcc/cp/parser.c:19771 0x103bf7ab cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:19335 0x103c0b53 cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:27053 0x103c1d73 cp_parser_explicit_specialization ../../gcc/gcc/cp/parser.c:16619 0x103ce603 cp_parser_declaration ../../gcc/gcc/cp/parser.c:12720 0x103cc6ef cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:12650 0x103ccaeb cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4387 0x103ccaeb c_parse_file() ../../gcc/gcc/cp/parser.c:38894 0x10563ee7 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1106