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

Sam Gardner <samuelgardner101 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samuelgardner101 at gmail dot 
com

--- Comment #2 from Sam Gardner <samuelgardner101 at gmail dot com> ---
Are there any (messy) workarounds for this? I have been refactoring a repo and
suddenly been getting this error too, but not for a templated bit. For me, it
is the constructor where the error points, with a different stacktrace to the
same `tree_check` function:

```
0x2b2f26f internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:787
0x15f3dcf crash_signal
        ../../gcc/gcc/toplev.cc:325
0x7da1be2eb04f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xb95807 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:3786
0xb95807 is_really_empty_class(tree_node*, bool)
        ../../gcc/gcc/cp/class.cc:9531
0xc9d55c emit_mem_initializers(tree_node*)
        ../../gcc/gcc/cp/init.cc:1543
0xda471d cp_parser_mem_initializer_list
        ../../gcc/gcc/cp/parser.cc:19870
0xda471d cp_parser_ctor_initializer_opt
        ../../gcc/gcc/cp/parser.cc:19778
0xda471d cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.cc:28919
0xd69565 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.cc:36157
0xd9e658 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.cc:36072
0xd9e658 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.cc:26082
0xd9fc98 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.cc:18099
0xdaea34 cp_parser_declaration
        ../../gcc/gcc/cp/parser.cc:17636
0xdae321 cp_parser_toplevel_declaration
        ../../gcc/gcc/cp/parser.cc:17740
0xdae321 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.cc:17445
0xdb26fd cp_parser_linkage_specification
        ../../gcc/gcc/cp/parser.cc:19163
0xdaedce cp_parser_declaration
        ../../gcc/gcc/cp/parser.cc:17606
0xdb1d4a cp_parser_toplevel_declaration
        ../../gcc/gcc/cp/parser.cc:17740
0xdb1d4a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.cc:5596
```

I am trying to make a reproducible example but I don't know exactly from the
refactor what is causing it. Might be completely different. Despite it coming
from `emit_mem_initializers`, on the two classes I get the error on, even I
remove all the class initializers in the constructor, still get the error. But
if you have a workaround I wonder if I may be able to adapt it to my issue.

Reply via email to