+2020-02-26 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93676 - value-init crash in template.
+ * init.c (build_new_1): Don't call build_vec_init in a template.
+
2020-02-26 Marek Polacek <polacek@redhat.com>
PR c++/93862 - ICE with static_cast when converting from int[].
explicit_value_init_p = true;
}
- if (processing_template_decl && explicit_value_init_p)
+ if (processing_template_decl)
{
+ /* Avoid an ICE when converting to a base in build_simple_base_path.
+ We'll throw this all away anyway, and build_new will create
+ a NEW_EXPR. */
+ tree t = fold_convert (build_pointer_type (elt_type), data_addr);
/* build_value_init doesn't work in templates, and we don't need
the initializer anyway since we're going to throw it away and
rebuild it at instantiation time, so just build up a single
constructor call to get any appropriate diagnostics. */
- init_expr = cp_build_fold_indirect_ref (data_addr);
+ init_expr = cp_build_fold_indirect_ref (t);
if (type_build_ctor_call (elt_type))
init_expr = build_special_member_call (init_expr,
complete_ctor_identifier,
+2020-02-26 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93676 - value-init crash in template.
+ * g++.dg/cpp0x/nsdmi-template19.C: New test.
+
2020-02-26 Marek Polacek <polacek@redhat.com>
PR c++/93862 - ICE with static_cast when converting from int[].