aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-16 20:43:19 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-11-16 20:43:19 -0500
commitbe5e69085cb3f29164e018e674cf0eb075989f0c (patch)
tree7920fdf218d6fb83f502596ed638203907ac71cf /gcc
parent66753821b5fd89c3fc5711240ecd7a3230586bf2 (diff)
downloadgcc-be5e69085cb3f29164e018e674cf0eb075989f0c.zip
gcc-be5e69085cb3f29164e018e674cf0eb075989f0c.tar.gz
gcc-be5e69085cb3f29164e018e674cf0eb075989f0c.tar.bz2
call.c (convert_like_real): Don't make a temp for copy-list-init.
* call.c (convert_like_real): Don't make a temp for copy-list-init. (build_over_call): Don't handle that here. (build_new_method_call): Use COMPLETE_OR_OPEN_TYPE_P for error. From-SVN: r166852
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c14
2 files changed, 10 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d651ba8..8c76af6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2010-11-16 Jason Merrill <jason@redhat.com>
+ * call.c (convert_like_real): Don't make a temp for copy-list-init.
+ (build_over_call): Don't handle that here.
+ (build_new_method_call): Use COMPLETE_OR_OPEN_TYPE_P for error.
+
PR c++/46497
* call.c (build_over_call): Check for =delete even when trivial.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 7fa1cf6..5e74bd2 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5290,6 +5290,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
conversion (i.e. the second step of copy-initialization), so
don't allow any more. */
flags |= LOOKUP_NO_CONVERSION;
+ if (TREE_CODE (expr) == TARGET_EXPR
+ && TARGET_EXPR_LIST_INIT_P (expr))
+ /* Copy-list-initialization doesn't actually involve a copy. */
+ return expr;
expr = build_temp (expr, totype, flags, &diag_kind, complain);
if (diag_kind && fn)
{
@@ -6049,15 +6053,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
else
arg = cp_build_indirect_ref (arg, RO_NULL, complain);
- if (TREE_CODE (arg) == TARGET_EXPR
- && TARGET_EXPR_LIST_INIT_P (arg))
- {
- /* Copy-list-initialization doesn't require the constructor
- to be defined. */
- }
/* [class.copy]: the copy constructor is implicitly defined even if
the implementation elided its use. */
- else if (!trivial || DECL_DELETED_FN (fn))
+ if (!trivial || DECL_DELETED_FN (fn))
{
mark_used (fn);
already_used = true;
@@ -6641,7 +6639,7 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args,
{
if (complain & tf_error)
{
- if (!COMPLETE_TYPE_P (basetype))
+ if (!COMPLETE_OR_OPEN_TYPE_P (basetype))
cxx_incomplete_type_error (instance_ptr, basetype);
else if (optype)
error ("no matching function for call to %<%T::operator %T(%A)%#V%>",