From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E70EE384A033; Mon, 20 Apr 2020 07:42:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E70EE384A033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587368540; bh=YQNxkz9Jq5z3Da7U3r7833KDchW6JKq5JbVhECykvto=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iayorFp611R8fqhTV4c1tZocMUt+loDnEabK8UN4Xp7Nj4TgvXedEGS8O3UTrZMXV 3yM5dTYenxg4pm+85Gi3KcXJ22PEPwJ/ks5ViFhuC6JTKyA2fkPr+ZQVc64xg8n3Dc J/shMUAL5tAgwetVUZklERpYLYtaL22ddkQbwa/o= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94628] [8/9/10 Regression] ICE in invalid_nonstatic_memfn_p at cp/typeck.c:1979 since r9-640-g1268ecc26fc1289b Date: Mon, 20 Apr 2020 07:42:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 07:42:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94628 --- Comment #8 from Martin Li=C5=A1ka --- (In reply to Nicholas Krause from comment #7) > After adding this it seems to work for me, Patrick: > case TYPE_ARGUMENT_PACK: > if (value_dependent_expression_p(TREE_TYPE(*tp))) > return *tp; > if (TEMPLATE_TYPE_PARAMETER_PACK(*tp)) > return *tp; > return NULL_TREE; >=20 > and gives me: > test.c: In function =E2=80=98std::common_type_t (forward(f)(std::integral_constant(), > (forward)(args)...)), decltype > (forward(f)(int_constant(), (forward)(args)...))..= .> > select(int, F&&, Args&& ...)=E2=80=99: > test.c:14:12: warning: =E2=80=98if constexpr=E2=80=99 only available with= =E2=80=98-std=3Dc++17=E2=80=99 or > =E2=80=98-std=3Dgnu++17=E2=80=99 > 14 | if constexpr(sizeof...(Is)>0) > | ^~~~~~~~~ > test.c: In function =E2=80=98std::common_type_t (forward(f)(std::integral_constant(), > (forward)(select::args)...)), decltype > (forward(f)(int_constant(), > (forward)(select::args)...))...> select(int, F&&, > Args&& ...) [with int I =3D 1; int ...Is =3D {}; F =3D t(int)::; > Args =3D {}]=E2=80=99: > test.c:17:1: warning: control reaches end of non-void function > [-Wreturn-type] > 17 | } > | ^ >=20 > with no segfault. I'm not sure if this is the correct part to add this te= st > for TYPE_ARGUMENT_PACK or if we would prefer it to be lower in the stack. The suggested change is wrong: /home/marxin/Programming/gcc2/objdir/./gcc/xgcc -shared-libgcc -B/home/marxin/Programming/gcc2/objdir/./gcc -nostdinc++ -L/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src -L/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src= /.libs -L/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/lib= supc++/.libs -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -x c++-header -nostdinc++ -g = -O2 -D_GNU_SOURCE=20 -I/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/inc= lude/x86_64-pc-linux-gnu -I/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/inc= lude -I/home/marxin/Programming/gcc2/libstdc++-v3/libsupc++ -O2 -g -std=3Dgnu++= 0x /home/marxin/Programming/gcc2/libstdc++-v3/include/precompiled/stdc++.h \ -o x86_64-pc-linux-gnu/bits/stdc++.h.gch/O2ggnu++0x.gch In file included from /home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/inclu= de/cmath:42, from /home/marxin/Programming/gcc2/libstdc++-v3/include/precompiled/stdc++.h:41: /home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/inclu= de/bits/cpp_type_traits.h:89:63: internal compiler error: tree check: expected template_type_parm or template_template_parm or bound_template_template_parm, have tree_list in instantiation_dependent_r, at cp/pt.c:26926 89 | enum { __value =3D bool(_Sp::__value) || bool(_Tp::__value) }; | ^ 0x8404c2 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/tree.c:9727 0x69234b tree_check3(tree_node*, char const*, int, char const*, tree_code, tree_code, tree_code) ../../gcc/tree.h:3327 0x69234b instantiation_dependent_r ../../gcc/cp/pt.c:26926 0x13749b3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ../../gcc/tree.c:11996 0xb10a88 cp_walk_subtrees(tree_node**, int*, tree_node* (*)(tree_node**, in= t*, void*), void*, hash_set = >*) ../../gcc/cp/tree.c:5061 0x1374a47 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ../../gcc/tree.c:12019 0x1377c85 walk_tree_without_duplicates_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ../../gcc/tree.c:12352 0xa97c87 instantiation_dependent_uneval_expression_p(tree_node*) ../../gcc/cp/pt.c:27033 0xa9e278 instantiation_dependent_expression_p(tree_node*) ../../gcc/cp/pt.c:27043 0x973ba7 is_nondependent_constant_expression(tree_node*) ../../gcc/cp/constexpr.c:8300 0x973fca fold_non_dependent_expr_template ../../gcc/cp/constexpr.c:6970 0xa98147 build_non_dependent_expr(tree_node*) ../../gcc/cp/pt.c:27531 0xb271ef build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) ../../gcc/cp/typeck.c:4245 0xa54e71 cp_parser_binary_expression ../../gcc/cp/parser.c:9719 0xa5671e cp_parser_assignment_expression ../../gcc/cp/parser.c:9859 0xa556cd cp_parser_constant_expression ../../gcc/cp/parser.c:10153 0xa62028 cp_parser_enumerator_definition ../../gcc/cp/parser.c:19479 0xa62028 cp_parser_enumerator_list ../../gcc/cp/parser.c:19419 0xa62028 cp_parser_enum_specifier ../../gcc/cp/parser.c:19350 0xa62028 cp_parser_type_specifier ../../gcc/cp/parser.c:17680 Can you please next time send patch suggestion that at least survive GCC bu= ild?=