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

Frank Heckenbach <f.heckenb...@fh-soft.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f.heckenb...@fh-soft.de

--- Comment #2 from Frank Heckenbach <f.heckenb...@fh-soft.de> ---
Got a similar ICE, hopefully the same issue.

It worked without ICE with g++ 6.3.0 and 7.3.0.

g++ 9.1.0 on Linux 4.14.0-0.bpo.3-amd64

Configured with: ../gcc-9.1.0/configure --prefix=/usr/local --disable-multilib

% g++-9 ice.cpp
ice.cpp: In function 'auto foo(bool, c)':
ice.cpp:9:24: internal compiler error: in ocp_convert, at cp/cvt.c:766
    9 |   return e ? throw 0 : v;
      |                        ^
0x58ad41 ocp_convert(tree_node*, tree_node*, int, int, int)
        ../../gcc-9.1.0/gcc/cp/cvt.c:766
0x71b652 check_return_expr(tree_node*, bool*)
        ../../gcc-9.1.0/gcc/cp/typeck.c:9799
0x6ea80f finish_return_stmt(tree_node*)
        ../../gcc-9.1.0/gcc/cp/semantics.c:894
0x68fccd cp_parser_jump_statement
        ../../gcc-9.1.0/gcc/cp/parser.c:12919
0x68fccd cp_parser_statement
        ../../gcc-9.1.0/gcc/cp/parser.c:11191
0x690338 cp_parser_statement_seq_opt
        ../../gcc-9.1.0/gcc/cp/parser.c:11657
0x6903f0 cp_parser_compound_statement
        ../../gcc-9.1.0/gcc/cp/parser.c:11611
0x6a6970 cp_parser_function_body
        ../../gcc-9.1.0/gcc/cp/parser.c:22660
0x6a6970 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-9.1.0/gcc/cp/parser.c:22711
0x6a7151 cp_parser_function_definition_after_declarator
        ../../gcc-9.1.0/gcc/cp/parser.c:27802
0x6a7e1b cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-9.1.0/gcc/cp/parser.c:27718
0x6a7e1b cp_parser_init_declarator
        ../../gcc-9.1.0/gcc/cp/parser.c:20297
0x68cfce cp_parser_simple_declaration
        ../../gcc-9.1.0/gcc/cp/parser.c:13541
0x6ad140 cp_parser_declaration
        ../../gcc-9.1.0/gcc/cp/parser.c:13238
0x6ad869 cp_parser_translation_unit
        ../../gcc-9.1.0/gcc/cp/parser.c:4701
0x6ad869 c_parse_file()
        ../../gcc-9.1.0/gcc/cp/parser.c:41181
0x76814b c_common_parse_file()
        ../../gcc-9.1.0/gcc/c-family/c-opts.c:1156
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

% cat ice.cpp
struct c
{
  c () = default;
  c (const c &) { }
};

auto foo (bool e, const c v)
{
  return e ? throw 0 : v;
}

int main ()
{
}

Reply via email to