[Bug c++/67142] New: [6 Regression] [C++1z] ICE: tree check: expected template_decl, have field_decl in equal, at cp/pt.c:1665

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 7 07:33:00 GMT 2015


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

            Bug ID: 67142
           Summary: [6 Regression] [C++1z] ICE: tree check: expected
                    template_decl, have field_decl in equal, at
                    cp/pt.c:1665
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

trippels@gcc2-power8 test % cat split_at.ii
namespace detail {
template <int> int split_at;
}
struct A {
  decltype(0) operator()();
};
template <typename> A make;
struct Tuple;
auto check =
    [](auto, auto, auto) { [](auto... xs) { [=] { make<Tuple>(xs...); }; }();
};
int main() {
  namespace vd = detail;
  check(vd::split_at<0>, make<Tuple>, make<Tuple>);
}

trippels@gcc2-power8 test % g++ -Wall -Wextra -c split_at.ii
trippels@gcc2-power8 test % g++ -std=c++1z -Wall -Wextra -c split_at.ii
split_at.ii: In instantiation of ‘<lambda(auto:1, auto:2,
auto:3)>::<lambda(auto:4 ...)>::<lambda()> [with auto:4 = {}; auto:1 = int;
auto:2 = A; auto:3 = A]’:
split_at.ii:10:63:   required from ‘struct<lambda(auto:1, auto:2,
auto:3)>::<lambda(auto:4 ...)> [with auto:4 = {}; auto:1 = int; auto:2 = A;
auto:3 = A]::<lambda()>’
split_at.ii:10:45:   required from ‘<lambda(auto:1, auto:2,
auto:3)>::<lambda(auto:4 ...)> [with auto:4 = {}; auto:1 = int; auto:2 = A;
auto:3 = A]’
split_at.ii:10:75:   required from ‘<lambda(auto:1, auto:2, auto:3)> [with
auto:1 = int; auto:2 = A; auto:3 = A]’
split_at.ii:13:50:   required from here
split_at.ii:10:62: internal compiler error: tree check: expected template_decl,
have field_decl in equal, at cp/pt.c:1665
     [](auto, auto, auto) { [](auto... xs) { [=] { make<Tuple>(xs...); }; }();
};
                                                              ^
0x10d3f1c3 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9499
0x101f3c0b tree_check
        ../../gcc/gcc/tree.h:2858
0x101f3c0b spec_hasher::equal(spec_entry*, spec_entry*)
        ../../gcc/gcc/cp/pt.c:1665
0x102561ff hash_table<spec_hasher, xcallocator>::find_with_hash(spec_entry*
const&, unsigned int)
        ../../gcc/gcc/hash-table.h:792
0x101f3f47 retrieve_specialization
        ../../gcc/gcc/cp/pt.c:1250
0x1021e89f tsubst_copy
        ../../gcc/gcc/cp/pt.c:13546
0x1021fd1f tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:10564
0x10229463 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:15714
0x1020d64b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:15025
0x1020e173 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:14436
0x1020defb tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:14608
0x1020d167 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:14422
0x1020defb tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:14608
0x1020a653 instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:21150
0x10248667 instantiate_class_template_1
        ../../gcc/gcc/cp/pt.c:10155
0x10248667 instantiate_class_template(tree_node*)
        ../../gcc/gcc/cp/pt.c:10223
0x1031f1f3 complete_type(tree_node*)
        ../../gcc/gcc/cp/typeck.c:138
0x10227c37 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:16339
0x1020d64b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:15025
0x1020e173 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:14436
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


More information about the Gcc-bugs mailing list