https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95984
Bug ID: 95984 Summary: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- Since the revision I see: $ cat /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C // PR c++/78816 // { dg-do compile { target c++14 } } void f(void (*f1)(int)) { f1(42); } template <typename Lambda> static auto callback(Lambda &&l) { static auto* p = &l; p = &l; return [](auto... x){ return (*p)(x...); }; } int main() { int x = 5; f(callback([=](int y){})); } $ g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C -Wnonnull /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C: In substitution of ‘template<class ... auto:1> constexpr callback<main()::<lambda(int)> >::<lambda(auto:1 ...)>::operator decltype (((const callback<main()::<lambda(int)> >::<lambda(auto:1 ...)>*)0)->operator()<auto:1 ...>(static_cast<auto:1&&>(callback::._anon_2::_FUN::<unnamed>) ...)) (*)(auto:1 ...)() const [with auto:1 = {int}]’: /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:18:27: required from here /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:13:10: warning: ‘this’ pointer null [-Wnonnull] 13 | return [](auto... x){ return (*p)(x...); }; | ^ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:13:10: note: in a call to non-static member function ‘callback<main()::<lambda(int)> >::<lambda(auto:1 ...)> [with auto:1 = {int}]’ ‘ Internal compiler error: Error reporting routines re-entered. 0xb04ef1 check_nonnull_arg /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5523 0xb05f72 check_function_arguments_recurse(void (*)(void*, tree_node*, unsigned long), void*, tree_node*, unsigned long) /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5881 0xb05cd1 check_function_arguments_recurse(void (*)(void*, tree_node*, unsigned long), void*, tree_node*, unsigned long) /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5813 0xb043e8 check_function_nonnull /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5315 0xb05a9e check_function_arguments(unsigned int, tree_node const*, tree_node const*, int, tree_node**, vec<unsigned int, va_heap, vl_ptr>*) /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5764 0x867a94 build_over_call /home/marxin/Programming/gcc/gcc/cp/call.c:8868 0x869e3c build_new_method_call_1 /home/marxin/Programming/gcc/gcc/cp/call.c:10348 0x86ad5f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) /home/marxin/Programming/gcc/gcc/cp/call.c:10423 0xa2b3f2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/marxin/Programming/gcc/gcc/cp/pt.c:20042 0xa2d1c0 tsubst(tree_node*, tree_node*, int, tree_node*) /home/marxin/Programming/gcc/gcc/cp/pt.c:15913 0x935ad7 dump_template_bindings /home/marxin/Programming/gcc/gcc/cp/error.c:416 0x935d30 dump_substitution /home/marxin/Programming/gcc/gcc/cp/error.c:1562 0x935d30 dump_substitution /home/marxin/Programming/gcc/gcc/cp/error.c:1550 0x92f610 dump_function_decl /home/marxin/Programming/gcc/gcc/cp/error.c:1720 0x937178 decl_to_string /home/marxin/Programming/gcc/gcc/cp/error.c:3101 0x937178 cp_printer /home/marxin/Programming/gcc/gcc/cp/error.c:4261 0x1e2aafc pp_format(pretty_printer*, text_info*) /home/marxin/Programming/gcc/gcc/pretty-print.c:1475 0x1e2cb80 pp_format_verbatim(pretty_printer*, text_info*) /home/marxin/Programming/gcc/gcc/pretty-print.c:1536 0x1e2cb80 pp_verbatim(pretty_printer*, char const*, ...) /home/marxin/Programming/gcc/gcc/pretty-print.c:1790 0x92ce56 print_instantiation_full_context /home/marxin/Programming/gcc/gcc/cp/error.c:3503 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.