2017-02-19 Jason Merrill <jason@redhat.com>
+ PR c++/78139 - destructor needed by new-expression
+ * call.c (build_special_member_call): Use tf_no_cleanup.
+
PR c++/78282 - auto template and pack expansion
* pt.c (find_parameter_packs_r): Don't walk into the type of
templates other than template template-parameters.
/* FIXME P0135 doesn't say how to handle direct initialization from a
type with a suitable conversion operator. Let's handle it like
copy-initialization, but allowing explict conversions. */
+ tsubst_flags_t sub_complain = tf_warning;
+ if (!is_dummy_object (instance))
+ /* If we're using this to initialize a non-temporary object, don't
+ require the destructor to be accessible. */
+ sub_complain |= tf_no_cleanup;
if (!reference_related_p (class_type, TREE_TYPE (arg)))
arg = perform_implicit_conversion_flags (class_type, arg,
- tf_warning, flags);
+ sub_complain,
+ flags);
if ((TREE_CODE (arg) == TARGET_EXPR
|| TREE_CODE (arg) == CONSTRUCTOR)
&& (same_type_ignoring_top_level_qualifiers_p