Created attachment 51589 [details] reproducer Possible a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98500 but without template templates. > g++ -Wall -Wextra -std=gnu++2a -c template_def.cxx template_def.cxx: In instantiation of ‘int bar() [with bool b = true]’: template_def.cxx:24:4: required from here template_def.cxx:2:18: internal compiler error: in tsubst, at cp/pt.c:14666 2 | template <auto f=[](){} > // works fine if rhs is not a lambda expression | ^~~~~~ 0x58c6c9 tsubst(tree_node*, tree_node*, int, tree_node*) ../.././gcc/cp/pt.c:14666 0x6d8985 tsubst_function_type ../.././gcc/cp/pt.c:14270 0x6c9ca4 tsubst(tree_node*, tree_node*, int, tree_node*) ../.././gcc/cp/pt.c:15110 0x6d96d5 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ../.././gcc/cp/pt.c:18376 0x6cdf03 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../.././gcc/cp/pt.c:19820 0x6c0d1c tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../.././gcc/cp/pt.c:18131 0x6d1dc2 tsubst_template_args ../.././gcc/cp/pt.c:12670 0x6d6648 tsubst_aggr_type ../.././gcc/cp/pt.c:12867 0x6c9eff tsubst(tree_node*, tree_node*, int, tree_node*) ../.././gcc/cp/pt.c:14565 0x6d3de3 tsubst_decl ../.././gcc/cp/pt.c:13947 0x6ca127 tsubst(tree_node*, tree_node*, int, tree_node*) ../.././gcc/cp/pt.c:14483 0x6c2ac0 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../.././gcc/cp/pt.c:17307 0x6c14df tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../.././gcc/cp/pt.c:17222 0x6c1e01 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../.././gcc/cp/pt.c:17535 0x6c4d3d tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../.././gcc/cp/pt.c:17207 0x6c4d3d instantiate_decl(tree_node*, bool, bool) ../.././gcc/cp/pt.c:25053 0x6df923 instantiate_pending_templates(int) ../.././gcc/cp/pt.c:25169 0x638628 c_parse_final_cleanups() ../.././gcc/cp/decl2.c:4818 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. > g++ --version g++ (GCC) 9.4.0 > uname -a Linux ... 4.9.0-15-amd64 #1 SMP Debian 4.9.258-1 (2021-03-08) x86_64 GNU/Linux
Reproducer should say "if bar is not a template function" in the comment.
*** Bug 109978 has been marked as a duplicate of this bug. ***
Fixed on the trunk for GCC 14 by the recent lambda template patches.