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

            Bug ID: 123189
           Summary: [16 Regression] ICE in gromacs since
                    r16-6140-g4a718209d448f6
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhruvc at gcc dot gnu.org
  Target Milestone: ---

Reduced from a version of the GROMACS v2025.2 source. Not entirely sure if the
reduced source is valid, but it gives the exact same backtrace as the original
source.

Flags: -O3 -march=native -mcpu=neoverse-v2

Reduced source code:

===
namespace {
template <typename a> class b
{
  friend void c<> () noexcept ();
};
} // namespace
===

Error before this commit:

===
test.i:4:32: error: expected primary-expression before ‘)’ token
[-Wtemplate-body]
    4 |   friend void c<> () noexcept ();
      |                                ^
===

Backtrace:

test.i:5:1: internal compiler error: Segmentation fault
    5 | };
      | ^
0x3e03023 internal_error(char const*, ...)
        ../../src/gcc/diagnostic-global-context.cc:787
0x1ffd293 crash_signal
        ../../src/gcc/toplev.cc:325
0x10659b0 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../src/gcc/tree.h:3759
0x141fc6b inline_needs_template_parms
        ../../src/gcc/cp/pt.cc:483
0x142034b maybe_begin_member_template_processing(tree_node*)
        ../../src/gcc/cp/pt.cc:558
0x13bc3f7 cp_parser_class_specifier
        ../../src/gcc/cp/parser.cc:28995
0x13a9b53 cp_parser_type_specifier
        ../../src/gcc/cp/parser.cc:21445
0x13a34a7 cp_parser_decl_specifier_seq
        ../../src/gcc/cp/parser.cc:18028
0x13cafd3 cp_parser_single_declaration
        ../../src/gcc/cp/parser.cc:35255
0x13c9feb cp_parser_template_declaration_after_parameters
        ../../src/gcc/cp/parser.cc:35012
0x13cae3b cp_parser_explicit_template_declaration
        ../../src/gcc/cp/parser.cc:35186
0x13caec3 cp_parser_template_declaration_after_export
        ../../src/gcc/cp/parser.cc:35205
0x13a64f3 cp_parser_template_declaration
        ../../src/gcc/cp/parser.cc:19644
0x13a052b cp_parser_declaration
        ../../src/gcc/cp/parser.cc:16786
0x13a09df cp_parser_toplevel_declaration
        ../../src/gcc/cp/parser.cc:16890
0x139fdd7 cp_parser_declaration_seq_opt
        ../../src/gcc/cp/parser.cc:16601
0x13ae5a7 cp_parser_namespace_body
        ../../src/gcc/cp/parser.cc:23513
0x13ae51b cp_parser_namespace_definition
        ../../src/gcc/cp/parser.cc:23491
0x13a07c3 cp_parser_declaration
        ../../src/gcc/cp/parser.cc:16849
0x13a09df cp_parser_toplevel_declaration
        ../../src/gcc/cp/parser.cc:16890
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