This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84045] ICE when is_nothrow_default_constructible is used before #include<set>
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Jan 2018 23:59:59 +0000
- Subject: [Bug c++/84045] ICE when is_nothrow_default_constructible is used before #include<set>
- Auto-submitted: auto-generated
- References: <bug-84045-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84045
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-01-25
CC| |dmalcolm at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Confirmed on trunk and with gcc 7 (but not gcc 6).
I had a go at reducing it (to eliminate the use of the header); this headerless
code (sadly not quite valid anymore) reproduces the ICE:
template <typename _Tp> struct is_nothrow_default_constructible { };
template <typename T, typename S> struct dummy {
typedef is_nothrow_default_constructible<T> dc;
void fu() noexcept(dc::value) {}
};
template <typename _Key_compare> struct _Rb_tree_key_compare {
_Rb_tree_key_compare()
noexcept(is_nothrow_default_constructible<_Key_compare>::value) {}
};
int main() { _Rb_tree_key_compare<int> bar; }
$ ./xg++ -B. -c ../../src/pr84045.C
../../src/pr84045.C: In instantiation of
‘_Rb_tree_key_compare<_Key_compare>::_Rb_tree_key_compare() [with _Key_compare
= int]’:
../../src/pr84045.C:13:40: required from here
int main() { _Rb_tree_key_compare<int> bar; }
^~~
../../src/pr84045.C:9:3: internal compiler error: tree check: accessed elt 2 of
tree_vec with 1 elts in tsubst, at cp/pt.c:13717
_Rb_tree_key_compare()
^~~~~~~~~~~~~~~~~~~~
0x772e64 tree_vec_elt_check_failed(int, int, char const*, int, char const*)
../../src/gcc/tree.c:9533
0x7cf5c5 tree_vec_elt_check(tree_node*, int, char const*, int, char const*)
../../src/gcc/tree.h:3353
0x9a85ce tsubst(tree_node*, tree_node*, int, tree_node*)
../../src/gcc/cp/pt.c:13717
0x9b67a7 tsubst_template_args
../../src/gcc/cp/pt.c:11801
0x9a7ca0 tsubst(tree_node*, tree_node*, int, tree_node*)
../../src/gcc/cp/pt.c:13992
0x9a8d63 tsubst(tree_node*, tree_node*, int, tree_node*)
../../src/gcc/cp/pt.c:13596
0x9c9433 tsubst_qualified_id
../../src/gcc/cp/pt.c:14539
0x9af072 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../src/gcc/cp/pt.c:17345
0x9d6e43 maybe_instantiate_noexcept(tree_node*, int)
../../src/gcc/cp/pt.c:22898
0x88b9b2 mark_used(tree_node*, int)
../../src/gcc/cp/decl2.c:5211
0x7c1b23 build_over_call
../../src/gcc/cp/call.c:8199
0x7c749c build_new_method_call_1
../../src/gcc/cp/call.c:9295
0x7c7aa8 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
../../src/gcc/cp/call.c:9364
0x7c4a2b build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
../../src/gcc/cp/call.c:8877
0x8b713c expand_default_init
../../src/gcc/cp/init.c:1889
0x8b713c expand_aggr_init_1
../../src/gcc/cp/init.c:2004
0x8b7f23 build_aggr_init(tree_node*, tree_node*, int, int)
../../src/gcc/cp/init.c:1744
0x84958f build_aggr_init_full_exprs
../../src/gcc/cp/decl.c:6163
0x84958f check_initializer
../../src/gcc/cp/decl.c:6311
0x86c7ef cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../src/gcc/cp/decl.c:7011