https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120873
Bug ID: 120873 Summary: internal compiler error: error reporting routines re-entered. since 11.1 Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mario.rodriguezb1 at um dot es Target Milestone: --- Program: ``` #include <iostream> using namespace std; template <class T> void myFunc(T a, decltype(cout << a) o=cout) { cout << o << endl; } int main() { myFunc(5); } ``` Stack dump: ``` internal compiler error: error reporting routines re-entered. 0x284430e diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2844425 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x28668af error_at(unsigned long, char const*, ...) ???:0 0xb72b2a satisfaction_cache::get() ???:0 0xb79b68 constraints_satisfied_p(tree_node*, tree_node*) ???:0 0xd4c236 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd4b94b tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd74a1d instantiate_template(tree_node*, tree_node*, int) ???:0 0xd7740a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) ???:0 0xb287c6 build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node*, tree_node**, int) ???:0 0xdd98b2 build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node*, tree_node**, int) ???:0 0xd4bb3d tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x28a4493 pretty_printer::format(text_info&) ???:0 0x28a9c53 pp_verbatim(pretty_printer*, char const*, ...) ???:0 0x2864678 diagnostic_text_output_format::on_report_diagnostic(diagnostic_info const&, diagnostic_t) ???:0 0x2843f76 diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2844425 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x2866fc6 internal_error(char const*, ...) ???:0 0xaede72 fancy_abort(char const*, int, char const*) ???:0 0x284383b diagnostic_context::finish() ???:0 ``` To quickly reproduce: https://godbolt.org/z/oKocEexe6