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

            Bug ID: 107400
           Summary: ICE tree check: expected class 'type', have
                    'declaration' (template_decl) in
                    get_originating_module_decl, at cp/module.cc:18587
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

With file g++.dg/template/pr59930-3.C :
(gcc configured with --enable-checking=yes)


$ g++-13-20221023 -c pr59930-3.C
$
$ g++-13-20221023 -c pr59930-3.C -fmodules-ts
'
tree check: expected class 'type', have 'declaration' (template_decl) in
get_originating_module_decl, at cp/module.cc:18587
   17 |     void method() const
      |          ^~~~~~
0x7019d3 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.cc:8886
0x98b558 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc/tree.h:3649
0x98b558 get_originating_module_decl(tree_node*)
        ../../gcc/cp/module.cc:18587
0x98b687 get_originating_module(tree_node*, bool)
        ../../gcc/cp/module.cc:18626
0x919fa6 dump_module_suffix
        ../../gcc/cp/error.cc:207
0x91acba dump_module_suffix
        ../../gcc/cp/error.cc:189
0x91acba dump_aggr_type
        ../../gcc/cp/error.cc:856
0x9262da dump_function_decl
        ../../gcc/cp/error.cc:1812
0x9294f6 decl_to_string
        ../../gcc/cp/error.cc:3297
0x9294f6 cp_printer
        ../../gcc/cp/error.cc:4471
0x22113c0 pp_format(pretty_printer*, text_info*)
        ../../gcc/pretty-print.cc:1475
0x2211a20 pp_format_verbatim(pretty_printer*, text_info*)
        ../../gcc/pretty-print.cc:1536
0x2211af4 pp_verbatim(pretty_printer*, char const*, ...)
        ../../gcc/pretty-print.cc:1790
0x919caf print_instantiation_full_context
        ../../gcc/cp/error.cc:3710
0x92a3fa maybe_print_instantiation_context
        ../../gcc/cp/error.cc:3858
0x92a3fa cp_diagnostic_starter
        ../../gcc/cp/error.cc:3548
0x21f02fc diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.cc:1549
0x21f0a3a diagnostic_impl
        ../../gcc/diagnostic.cc:1712
0x21f1686 internal_error(char const*, ...)
        ../../gcc/diagnostic.cc:2112
0x7019d3 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.cc:8886

Reply via email to