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

            Bug ID: 122091
           Summary: internal compiler error: in fold_convert_loc, at
                    fold-const.cc:2504
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qingren2hxb at gmail dot com
  Target Milestone: ---

Input:

class base {};
class derived : virtual public base {
public:
  template<typename Arg> constexpr derived(Arg) {}
};
int main() {
  derived obj(1.);
}

Output:

test.cpp:8:17: internal compiler error: in fold_convert_loc, at
fold-const.cc:2504
    8 |   derived obj(1.);
      |                 ^
0x1a1ba6d fold_convert_loc(unsigned int, tree_node*, tree_node*)
        /workspace/gcc/gcc/fold-const.cc:2504
0xe5b394 cp_fold_convert(tree_node*, tree_node*)
        /workspace/gcc/gcc/cp/cvt.cc:627
0xd9579f adjust_temp_type
        /workspace/gcc/gcc/cp/constexpr.cc:1686
0xd965cc cxx_bind_parameters_in_call
        /workspace/gcc/gcc/cp/constexpr.cc:1822
0xd9e60a cxx_eval_call_expression
        /workspace/gcc/gcc/cp/constexpr.cc:2878
0xdbc75f cxx_eval_constant_expression
        /workspace/gcc/gcc/cp/constexpr.cc:7102
0xdc58b5 cxx_eval_outermost_constant_expr
        /workspace/gcc/gcc/cp/constexpr.cc:8317
0xdc83f1 maybe_constant_init_1
        /workspace/gcc/gcc/cp/constexpr.cc:8809
0xdc84d5 maybe_constant_init(tree_node*, tree_node*, bool)
        /workspace/gcc/gcc/cp/constexpr.cc:8827
0xfaf003 expand_default_init
        /workspace/gcc/gcc/cp/init.cc:2219
0xfaf974 expand_aggr_init_1
        /workspace/gcc/gcc/cp/init.cc:2324
0xfad5f7 build_aggr_init(tree_node*, tree_node*, int, int)
        /workspace/gcc/gcc/cp/init.cc:2043
0xec9cba build_aggr_init_full_exprs
        /workspace/gcc/gcc/cp/decl.cc:7377
0xecb602 check_initializer
        /workspace/gcc/gcc/cp/decl.cc:7542
0xed68ea cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /workspace/gcc/gcc/cp/decl.cc:8624
0x1187458 cp_parser_init_declarator
        /workspace/gcc/gcc/cp/parser.cc:23052
0x116acae cp_parser_simple_declaration
        /workspace/gcc/gcc/cp/parser.cc:15403
0x116a436 cp_parser_block_declaration
        /workspace/gcc/gcc/cp/parser.cc:15223
0x11671c4 cp_parser_declaration_statement
        /workspace/gcc/gcc/cp/parser.cc:14484
0x115e79d cp_parser_statement
        /workspace/gcc/gcc/cp/parser.cc:12542
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