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

            Bug ID: 84350
           Summary: [7/8 Regression] ICE with new and auto
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 7.1.0:

===============================================
template<typename... T> void foo(T... t)
{
  new auto(t...);
}

void bar()
{
  foo();
}
===============================================

bug.cc: In instantiation of 'void foo(T ...) [with T = {}]':
bug.cc:8:7:   required from here
bug.cc:3:3: internal compiler error: Segmentation fault
   new auto(t...);
   ^~~~~~~~~~~~~~
0xeb087f crash_signal
        ../../gcc/gcc/toplev.c:325
0x95f158 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/gcc/tree.h:3245
0x95f158 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:25993
0x960805 do_auto_deduction(tree_node*, tree_node*, tree_node*)
        ../../gcc/gcc/cp/pt.c:25953
0x8d1104 build_new(vec<tree_node*, va_gc, vl_embed>**, tree_node*, tree_node*,
vec<tree_node*, va_gc, vl_embed>**, int, int)
        ../../gcc/gcc/cp/init.c:3596
0x95bf0c tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:17582
0x968d99 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:17114
0x968d99 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16852
0x968620 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16073
0x965eb1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16336
0x965148 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16044
0x965148 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/gcc/cp/pt.c:23398
0x98f79b instantiate_pending_templates(int)
        ../../gcc/gcc/cp/pt.c:23514
0x8b19fb c_parse_final_cleanups()
        ../../gcc/gcc/cp/decl2.c:4715
Please submit a full bug report, [etc.]

Reply via email to