https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118672
Bug ID: 118672 Summary: ICE on invalid template lambda expression Product: gcc Version: 14.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- This program ``` auto l = []<int>() -> decltype([]<int=0>{}) { return {}; }.template operator()<0>; ``` is invalid (missed () before last semicolon), but it makes GCC print: ``` internal compiler error: error reporting routines re-entered. 0x203063d diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2030fb8 warning(int, char const*, ...) ???:0 0x8147df start_preparsed_function(tree_node*, tree_node*, int) ???:0 0x856029 start_lambda_function(tree_node*, tree_node*) ???:0 0x944797 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x939c70 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x2043afe pp_format(pretty_printer*, text_info*, urlifier const*) ???:0 0x2030477 diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2031415 permerror(unsigned int, char const*, ...) ???:0 0x7b12b7 instantiate_type(tree_node*, tree_node*, int) ???:0 0x9a7390 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ???:0 0x8276ee cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int, cp_decomp*) ???:0 0x90ee14 c_parse_file() ???:0 0xa0d1b9 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. ``` Online demo: https://gcc.godbolt.org/z/W8ExeToW9