https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117324
Bug ID: 117324 Summary: internal compiler error: Segmentation fault in break_out_target_exprs(tree_node*, bool) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yihan4845 at gmail dot com Target Milestone: --- Compiler Explorer: https://godbolt.org/z/869j3xz9o The following program: ```cpp template<typename = int> struct ct1 { friend void f(ct1, int = [](int p = [] { }) { return p; }(); ) {} }; void test() { f(ct1{}); } ``` will trigger segmentation fault for gcc trunk. Stack dump: ``` 0x287e175 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x28945d5 internal_error(char const*, ...) ???:0 0xaa99c4 set_flags_from_callee(tree_node*) ???:0 0x176a8dc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) ???:0 0xd43852 break_out_target_exprs(tree_node*, bool) ???:0 0xab019c convert_default_arg(tree_node*, tree_node*, tree_node*, int, int) ???:0 0xac095e build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ???:0 0xd1c8f6 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ???:0 0xc9e57a c_parse_file() ???:0 0xdf7f99 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. Compiler returned: 1 ```