From c8361db176c68d1d3b4085970b8862387785e0c2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 17 May 2010 15:53:45 -0400 Subject: re PR c++/44158 ([C++0x] wrong overload resolution for copy-initialization from an rvalue) PR c++/44158 * call.c (build_over_call): Don't do bitwise copy for move ctor. From-SVN: r159508 --- gcc/cp/call.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/cp/call.c') diff --git a/gcc/cp/call.c b/gcc/cp/call.c index c063992..5d13007 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5776,7 +5776,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) } /* [class.copy]: the copy constructor is implicitly defined even if the implementation elided its use. */ - else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn))) + else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn)) + || move_fn_p (fn)) { mark_used (fn); already_used = true; @@ -5794,7 +5795,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) { if (TREE_CODE (arg) == TARGET_EXPR) return arg; - else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn))) + else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)) + && !move_fn_p (fn)) return build_target_expr_with_type (arg, DECL_CONTEXT (fn)); } else if (TREE_CODE (arg) == TARGET_EXPR -- cgit v1.1