https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120863
Bug ID: 120863 Summary: ICE: in convert_like_internal, at cp/call.cc:9228 Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rush102333 at gmail dot com Target Milestone: --- The following code starts to crash since gcc-10.2: https://godbolt.org/z/8oxGfvd9f ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ struct X { }; struct Y : X { }; template<typename T> X &&f1(Y &y) { T instance; return y; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stack Dump: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <source>: In function 'X&& f1(Y&)': <source>:6:9: internal compiler error: in convert_like_internal, at cp/call.cc:9228 6 | return y; } | ^ 0x2843285 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x2865e26 internal_error(char const*, ...) ???:0 0xaedd7c fancy_abort(char const*, int, char const*) ???:0 0xb25678 initialize_reference(tree_node*, tree_node*, int, int) ???:0 0xdf27e0 convert_for_initialization(tree_node*, tree_node*, tree_node*, int, impl_conv_rhs, tree_node*, int, int) ???:0 0xdf408d check_return_expr(tree_node*, bool*, bool*) ???:0 0xd938d8 finish_return_stmt(tree_node*) ???:0 0xd16663 c_parse_file() ???:0 0xe7e3c9 c_common_parse_file() ???:0 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~