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

            Bug ID: 84789
           Summary: [6/7/8 Regression] ICE with broken variable
                    declaration in template class
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid-code code snippet triggers an ICE since GCC 6.3.0:

========================================
struct A
{
  typedef int I;
};

template<typename> struct B : A {};

template<typename T> struct C : B<T>
{
  B<T>::A::I::I i;
};
========================================

bug.cc:10:3: internal compiler error: in resolve_typename_type, at
cp/pt.c:25199
   B<T>::A::I::I i;
   ^~~~
0x64b44a resolve_typename_type(tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:25199
0x932008 cp_parser_nested_name_specifier_opt
        ../../gcc/gcc/cp/parser.c:6190
0x931624 cp_parser_id_expression
        ../../gcc/gcc/cp/parser.c:5702
0x939b0a cp_parser_parse_and_diagnose_invalid_type_name
        ../../gcc/gcc/cp/parser.c:3452
0x92b507 cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:23525
0x92be2a cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:23374
0x92be2a cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:22516
0x92de89 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:22768
0x92de89 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:16774
0x93b0c6 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:13625
0x93f805 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:27184
0x93fb8c cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:26876
0x94044c cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:27113
0x94044c cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:27132
0x9457b9 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12729
0x945aa1 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12656
0x945d94 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4561
0x945d94 c_parse_file()
        ../../gcc/gcc/cp/parser.c:38995
0xa44906 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1132
Please submit a full bug report, [etc.]

Reply via email to