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

            Bug ID: 108207
           Summary: ICE in testcase g++.dg/other/ptrmem8.C on mingw
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

All variants of this test fail (98, 14, 17, 20)

// Target: x86_64-w64-mingw32
// Configured with: ../configure --disable-nls --with-sysroot=/tmp/rtmingw
--target=x86_64-w64-mingw32 --disable-multilib
--enable-languages=c,c++,fortran,lto,objc,obj-c++,m2,rust
// Thread model: win32
// Supported LTO compression algorithms: zlib zstd
// gcc version 13.0.0 20221222 (experimental) (GCC)
bbe04bade0cc3b17e62c2af3d89b899367e7d2d1


g++.dg/other/ptrmem8.C: In function 'void foo(void (A::*)())':
g++.dg/other/ptrmem8.C:9:9: internal compiler error: in build_ptrmemfunc, at
cp/typeck.cc:10015


0x7f38c0 build_ptrmemfunc(tree_node*, tree_node*, int, bool, int)
        ../../gcc/cp/typeck.cc:10015
0xc643bb cp_build_addr_expr_1
        ../../gcc/cp/typeck.cc:7241
0xc64704 cp_build_addr_expr_strict
        ../../gcc/cp/typeck.cc:7269
0xc64704 build_x_unary_op(unsigned int, tree_code, cp_expr, tree_node*, int)
        ../../gcc/cp/typeck.cc:6890
0xb9b7c3 cp_parser_unary_expression
        ../../gcc/cp/parser.cc:9039
0xb688bc cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10101
0xb69612 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10444
0xb6ba73 cp_parser_expression
        ../../gcc/cp/parser.cc:10614
0xb6fa07 cp_parser_expression_statement
        ../../gcc/cp/parser.cc:12758
0xb7aced cp_parser_statement
        ../../gcc/cp/parser.cc:12538
0xb7bfdd cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12909
0xb7c0b7 cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12861
0xb9ea55 cp_parser_function_body
        ../../gcc/cp/parser.cc:25280
0xb9ea55 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25331
0xba09fe cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:31942
0xba1eb0 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.cc:31859
0xba1eb0 cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22734
0xba928e cp_parser_single_declaration
        ../../gcc/cp/parser.cc:32459
0xba94b4 cp_parser_template_declaration_after_parameters
        ../../gcc/cp/parser.cc:32012
0xba9d40 cp_parser_explicit_template_declaration
        ../../gcc/cp/parser.cc:32285



Preprocessed source is as you might expect, given the lack of includes:
struct A {};

template<int> void foo(void (A::* f)())
{
  A a;
  &(a.*f);
}

template<int> void bar(void (A::* f)())
{
  A *p;
  &(p->*f);
}

Reply via email to