https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86740
Bug ID: 86740 Summary: ICE with hana and nested lambdas (tsubst_copy, at cp/pt.c:15325) Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: markus at dreseler dot de Target Milestone: --- Created attachment 44467 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44467&action=edit Test case The attached file causes the following ICE: gccice.cpp:35:26: internal compiler error: in tsubst_copy, at cp/pt.c:15325 std::cout << params << std::endl; ^~~~~~ 0x599570 tsubst_copy ../../src/gcc/cp/pt.c:15325 0x6ce257 tsubst_copy ../../src/gcc/cp/pt.c:15301 0x6ce257 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:18843 0x6cf567 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:17782 0x6cf640 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:18630 0x6c1641 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:17412 0x6c4a04 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:16584 0x6c4a04 tsubst_decl ../../src/gcc/cp/pt.c:13723 0x6bcdf7 tsubst_copy ../../src/gcc/cp/pt.c:15431 0x6ce257 tsubst_copy ../../src/gcc/cp/pt.c:15301 0x6ce257 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:18843 0x6cf567 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:17782 0x6d0c69 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:17553 0x6ce2df tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:18923 0x6ce8f6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:18248 0x6c1641 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:17412 0x6c1425 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:16613 0x6c0cc8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:16599 0x6c0bab tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:16896 0x6c1ffb tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../src/gcc/cp/pt.c:16866 I tried to cut the test case down as much as possible, but even seemingly unrelated changes make the bug disappear. For example, try replacing YESSIR with true. First seen on g++-8 (Ubuntu 8.1.0-1ubuntu1) 8.1.0, but reproduced with svn revision 263064. Command line is 'g++-8 -std=c++17 gccice.cpp'. Clang compiles the file. There is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67411, which looks somewhat similar, but the bug described there is already fixed.