public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xerofoify at gmail dot com" <gcc-bugzilla@gcc.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 18:57:16 +0000	[thread overview]
Message-ID: <bug-94628-4-KZkLlZi8cu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94628-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94628

--- Comment #10 from Nicholas Krause <xerofoify at gmail dot com> ---
(In reply to Martin Liška 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;
> > 
> > and gives me:
> > test.c: In function ‘std::common_type_t<decltype
> > (forward<F>(f)(std::integral_constant<int, i>(),
> > (forward<decltype(args)>)(args)...)), decltype
> > (forward<F>(f)(int_constant<Is>(), (forward<decltype(args)>)(args)...))...>
> > select(int, F&&, Args&& ...)’:
> > test.c:14:12: warning: ‘if constexpr’ only available with ‘-std=c++17’ or
> > ‘-std=gnu++17’
> >    14 |         if constexpr(sizeof...(Is)>0)
> >       |            ^~~~~~~~~
> > test.c: In function ‘std::common_type_t<decltype
> > (forward<F>(f)(std::integral_constant<int, i>(),
> > (forward<decltype(select::args)>)(select::args)...)), decltype
> > (forward<F>(f)(int_constant<Is>(),
> > (forward<decltype(select::args)>)(select::args)...))...> select(int, F&&,
> > Args&& ...) [with int I = 1; int ...Is = {}; F = t(int)::<lambda(auto:1)>;
> > Args = {}]’:
> > test.c:17:1: warning: control reaches end of non-void function
> > [-Wreturn-type]
> >    17 | }
> >       | ^
> > 
> > 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 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/
> 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 
> -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=gnu++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:41:
> /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 = 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*, false, default_hash_traits<tree_node*> >*,
> tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
> void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
> 	../../gcc/tree.c:11996
> 0xb10a88 cp_walk_subtrees(tree_node**, int*, tree_node* (*)(tree_node**,
> int*, void*), void*, hash_set<tree_node*, false,
> default_hash_traits<tree_node*> >*)
> 	../../gcc/cp/tree.c:5061
> 0x1374a47 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
> void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
> tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
> void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
> 	../../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<tree_node*, false,
> default_hash_traits<tree_node*> >*))
> 	../../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
> build?

I just tested this with config:
../gcc/configure --enable-lanuages=c,c++ --enable-threads -disable-multilibs
--enable-checking=yes --prefix="$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 config I
will look into why if the patch still does not build for.

  parent reply	other threads:[~2020-04-20 18:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 21:41 [Bug c++/94628] New: segfault decltype roland at rschulz dot eu
2020-04-16 21:55 ` [Bug c++/94628] " mpolacek at gcc dot gnu.org
2020-04-17  6:35 ` [Bug c++/94628] [8/9/10 Regression] ICE in invalid_nonstatic_memfn_p at cp/typeck.c:1979 since r9-640-g1268ecc26fc1289b marxin at gcc dot gnu.org
2020-04-17  7:04 ` rguenth at gcc dot gnu.org
2020-04-18 14:41 ` ppalka at gcc dot gnu.org
2020-04-18 14:42 ` ppalka at gcc dot gnu.org
2020-04-18 22:00 ` xerofoify at gmail dot com
2020-04-18 23:36 ` mpolacek at gcc dot gnu.org
2020-04-19 14:42 ` ppalka at gcc dot gnu.org
2020-04-20  4:26 ` xerofoify at gmail dot com
2020-04-20  7:42 ` marxin at gcc dot gnu.org
2020-04-20 18:55 ` xerofoify at gmail dot com
2020-04-20 18:57 ` xerofoify at gmail dot com [this message]
2020-04-20 19:10 ` mpolacek at gcc dot gnu.org
2020-04-20 19:26 ` marxin at gcc dot gnu.org
2020-04-20 22:56 ` cvs-commit at gcc dot gnu.org
2020-04-20 22:57 ` [Bug c++/94628] [8/9 " ppalka at gcc dot gnu.org
2021-04-02 14:28 ` ppalka at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-05-14  9:53 ` [Bug c++/94628] [9 " jakub at gcc dot gnu.org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2022-05-27  8:51 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94628-4-KZkLlZi8cu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).