https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100006
--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> --- https://godbolt.org/z/o6h8GP6ae Maybe same form: template <class... Ts> auto f() { [] { struct S : Ts {}; }; } int main() { f<>(); } <source>:3:15: internal compiler error: in dependent_type_p, at cp/pt.c:26745 3 | [] { struct S : Ts {}; }; | ^ 0x1d00959 internal_error(char const*, ...) ???:0 0x6bb099 fancy_abort(char const*, int, char const*) ???:0 0x8fa338 dependent_type_p(tree_node*) ???:0 0x7a9464 xref_basetypes(tree_node*, tree_node*) ???:0 0x95aa80 instantiate_class_template(tree_node*) ???:0 0x94abba tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x91d54f instantiate_decl(tree_node*, bool, bool) ???:0 0x7c7a3e maybe_instantiate_decl(tree_node*) ???:0 0x7c91a0 mark_used(tree_node*, int) ???:0 0x6de907 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ???:0 0x981c3c finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ???:0 0x8e224d c_parse_file() ???:0 0xa612e2 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source if appropriate.