From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 93A803858D31; Mon, 20 Apr 2020 18:57:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93A803858D31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587409036; bh=u6cqVLMjcKSTkFekm8S3WS4NOEI+hAKCTx5+a2ZCdSs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DgcjYhJDgGXg4PYAyGnmiEzkZfOw3M/AVCPhFjmE5fYrkwRqldxXleK68Pk907EeE bjcSINa+fr7cZoWHxKhbYwsJRC877Qznax1aDD4fNfz+BXryaLJWQK6+K79fuxeG8y AFsbTA6jHMBL8ac89uGYIBC0S4yX5xEnIHjEk/MY= From: "xerofoify at gmail dot com" 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 18:57:16 +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: xerofoify at gmail dot com 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 18:57:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94628 --- Comment #10 from Nicholas Krause --- (In reply to Martin Li=C5=A1ka from comment #8) > (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 wi= th =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 = test > > for TYPE_ARGUMENT_PACK or if we would prefer it to be lower in the stac= k. >=20 > The suggested change is wrong: >=20 > /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/s= rc > -L/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/s= rc/. > libs > -L/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/ > libsupc++/.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/ > include/x86_64-pc-linux-gnu > -I/home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/ > include -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/ > include/cmath:42, > from > /home/marxin/Programming/gcc2/libstdc++-v3/include/precompiled/stdc++.h:4= 1: > /home/marxin/Programming/gcc2/objdir/x86_64-pc-linux-gnu/libstdc++-v3/ > include/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**, > int*, void*), void*, hash_set default_hash_traits >*) > ../../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 default_hash_traits >*)) > ../../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 >=20 > Can you please next time send patch suggestion that at least survive GCC > build? I just tested this with config: ../gcc/configure --enable-lanuages=3Dc,c++ --enable-threads -disable-multil= ibs --enable-checking=3Dyes --prefix=3D"$HOME/obdjir" I've attached the building patch above as build on a GNU Cauldron power machine. No idea why it's not building for you but if you need me your conf= ig I will look into why if the patch still does not build for.=