Commit 680ed106 by Jason Merrill Committed by Jason Merrill

PR c++/79679 - missing destructor for argument

	PR c++/79679 - missing destructor for argument
	* call.c (build_over_call): Don't pass tf_no_cleanup to argument
	conversions.

From-SVN: r245672
parent a4759f36
2017-02-22 Jason Merrill <jason@redhat.com> 2017-02-22 Jason Merrill <jason@redhat.com>
PR c++/79679 - missing destructor for argument
* call.c (build_over_call): Don't pass tf_no_cleanup to argument
conversions.
* pt.c (do_class_deduction): Handle 0 argument case. * pt.c (do_class_deduction): Handle 0 argument case.
2017-02-22 Jakub Jelinek <jakub@redhat.com> 2017-02-22 Jakub Jelinek <jakub@redhat.com>
......
...@@ -7838,12 +7838,13 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) ...@@ -7838,12 +7838,13 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
if (flags & LOOKUP_NO_CONVERSION) if (flags & LOOKUP_NO_CONVERSION)
conv->user_conv_p = true; conv->user_conv_p = true;
val = convert_like_with_context (conv, arg, fn, i - is_method, tsubst_flags_t arg_complain = complain & (~tf_no_cleanup);
conversion_warning if (!conversion_warning)
? complain arg_complain &= ~tf_warning;
: complain & (~tf_warning));
val = convert_for_arg_passing (type, val, complain); val = convert_like_with_context (conv, arg, fn, i - is_method,
arg_complain);
val = convert_for_arg_passing (type, val, arg_complain);
if (val == error_mark_node) if (val == error_mark_node)
return error_mark_node; return error_mark_node;
......
// PR c++/79679
// { dg-do run }
int count;
struct S {
S() { ++count; }
S(const S&) { ++count; }
~S() { --count; }
};
struct T {
T(S) {}
};
int main() {
{
S s;
T u(s);
}
if (count)
__builtin_abort();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment