https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99809
--- Comment #4 from 康桓瑋 <hewillk at gmail dot com> --- Hey, the following code (a small variation with PR 100109) triggers the same ICE in cp/constexpr.c:8889 on gcc 8-11, so maybe this is a regression bug? template <class... Ts> void f(Ts... args) { [=]{ enum { x = [=]{ args; }() }; }; } template void f<>(); <source>: In instantiation of 'void f(Ts ...) [with Ts = {}]': <source>:8:19: required from here <source>:4:16: sorry, unimplemented: unexpected AST of kind nontype_argument_pack 4 | enum { x = [=]{ args; }() }; | ^~~~~~~~~~~~ <source>:4:16: internal compiler error: in potential_constant_expression_1, at cp/constexpr.c:8889 0x1d02fb9 internal_error(char const*, ...) ???:0 0x6bb4f9 fancy_abort(char const*, int, char const*) ???:0 0x72a64f potential_constant_expression(tree_node*) ???:0 0x7b11c5 finish_function(bool) ???:0 0x80714a finish_lambda_function(tree_node*) ???:0 0x94ba0b tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x92c502 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ???:0 0x91848d tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x918537 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x94ba02 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ???:0 0x91e36f instantiate_decl(tree_node*, bool, bool) ???:0 0x96023b instantiate_pending_templates(int) ???:0 0x7cd659 c_parse_final_cleanups() ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report.