https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88295
Bug ID: 88295 Summary: ICE on (invalid) C++11 code: tree check: expected class ‘expression’, have ‘exceptiona’ (argument_pack_select) in tree_operand_check, at tree.h:3652 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- This appears to be a recent regression. The error message also contains a small, but obvious typo: `exceptiona' should have been ‘exceptional’. $ g++tk -v Using built-in specs. COLLECT_GCC=g++tk COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap Thread model: posix gcc version 9.0.0 20181201 (experimental) [trunk revision 266708] (GCC) $ $ g++tk -c tmp.cpp tmp.cpp: In instantiation of ‘void f(T ...) [with T = {int}]’: tmp.cpp:6:21: required from here tmp.cpp:3:8: internal compiler error: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3652 3 | f (t (t ...) ...); | ~~^~~~~~~ 0x605f6b tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-source-trunk/gcc/tree.c:9810 0x829ff9 expr_check(tree_node*, char const*, int, char const*) ../../gcc-source-trunk/gcc/tree.h:3323 0x829ff9 tree_operand_check(tree_node*, int, char const*, int, char const*) ../../gcc-source-trunk/gcc/tree.h:3652 0x829ff9 argument_pack_element_is_expansion_p ../../gcc-source-trunk/gcc/cp/pt.c:11522 0x85ddfd tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:12147 0x8484de tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:18648 0x850b27 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-source-trunk/gcc/cp/pt.c:17745 0x85e989 gen_elem_of_pack_expansion_instantiation ../../gcc-source-trunk/gcc/cp/pt.c:11687 0x85e989 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:12301 0x8484de tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:18648 0x850b27 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-source-trunk/gcc/cp/pt.c:17745 0x850369 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16866 0x84e8da tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-source-trunk/gcc/cp/pt.c:17152 0x84cda6 instantiate_decl(tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:24446 0x892ad0 instantiate_pending_templates(int) ../../gcc-source-trunk/gcc/cp/pt.c:24562 0x76ae22 c_parse_final_cleanups() ../../gcc-source-trunk/gcc/cp/decl2.c:4771 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. $ ----------------------------------------------- template < typename ... T > void f (T ... t) { f (t (t ...) ...); } template void f (int);