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

            Bug ID: 121152
           Summary: ICE: Segmentation fault in
                    'complete_type_or_maybe_complain(tree_node*,
                    tree_node*, int)'
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code, needs-reduction
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rush102333 at gmail dot com
  Target Milestone: ---

Test input: https://godbolt.org/z/6h9cTbbP1.

Started to bailing out since gcc-12.

Sorry for not being able to further simplify the test code.

Stack Dump:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<source>:6:31: note: declaration of 'class std::allocator<char>'
    6 |   template < typename > class allocator;
      |                               ^~~~~~~~~
<source>:68:41: internal compiler error: Segmentation fault
   68 |     typedef decltype (_S_pointer_helper ((_Alloc *) 0)) __pointer;
      |                       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
0x287a4d5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x289c1b6 internal_error(char const*, ...)
        ???:0
0xd55d1d tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd56274 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd84b51 instantiate_class_template(tree_node*)
        ???:0
0xde2ff4 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ???:0
0xbe25b5 xref_basetypes(tree_node*, tree_node*)
        ???:0
0xd8457c instantiate_class_template(tree_node*)
        ???:0
0xde2ff4 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ???:0
0xd5744e tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd56037 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd56274 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd84b51 instantiate_class_template(tree_node*)
        ???:0
0xbe01cb grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0xc04500 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ???:0
0xd207f3 c_parse_file()
        ???:0
0xe8add9 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to