https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94508
Bug ID: 94508 Summary: ICE in tsubst_copy, at cp/pt.c:16186 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- All g++ branches from 6 to the current master (10.0.1-alpha20200405 snapshot, g:2a1a0c8c0db0aae50a2cebce59bd64334cd6ba2a) ICE when compiling the following testcase, extracted from test/SemaTemplate/instantiate-requires-clause.cpp from the clang 10.0.0 test suite, w/ -fconcepts: template<typename T> struct S4 { void foo() requires (*this) { } }; static_assert((S4<int>{}.foo(), true)); % g++-10.0.1 -fconcepts -c cxbvanvw.cpp cxbvanvw.cpp: In instantiation of 'void S4<T>::foo() requires *(S4<T>*)this [with T = int]': cxbvanvw.cpp:6:30: required from here cxbvanvw.cpp:3:25: internal compiler error: in tsubst_copy, at cp/pt.c:16186 3 | void foo() requires (*this) { } | ^~~~ 0x65dc87 tsubst_copy /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/pt.c:16186 0x9f9990 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/pt.c:20244 0x9f9be8 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/pt.c:19121 0x9fb247 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/pt.c:19099 0x9eb259 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/pt.c:18613 0x8b96c2 satisfy_constraint_r /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/constraint.cc:2595 0x8b9ab8 satisfy_constraint /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/constraint.cc:2677 0x8ba9d8 constraint_satisfaction_value /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/constraint.cc:2695 0x8babaa constraints_satisfied_p(tree_node*) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/constraint.cc:2846 0x86e8f1 add_function_candidate /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/call.c:2288 0x86ff1c add_candidates /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/call.c:5854 0x876ec3 add_candidates /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/call.c:5756 0x876ec3 build_new_method_call_1 /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/call.c:10204 0x8781bf build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/call.c:10413 0x9aa259 cp_parser_postfix_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:7430 0x98b7e9 cp_parser_binary_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:9554 0x98d49e cp_parser_assignment_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:9859 0x98d863 cp_parser_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:10027 0x99e1bb cp_parser_primary_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:5359 0x9a9607 cp_parser_postfix_expression /var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/cp/parser.c:7257