OSDN Git Service

PR c++/20669
[pf3gnuchains/gcc-fork.git] / gcc / cp / call.c
index 46779fa..dccb1d4 100644 (file)
@@ -464,7 +464,7 @@ null_ptr_cst_p (tree t)
      an rvalue of type std::nullptr_t. */
   t = integral_constant_value (t);
   if (t == null_node
-      || NULLPTR_TYPE_P (TREE_TYPE (t)))
+      || TREE_CODE (TREE_TYPE (t)) == NULLPTR_TYPE)
     return true;
   if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t))
     {
@@ -783,7 +783,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
      null pointer constant of integral type can be converted to an
      rvalue of type std::nullptr_t. */
   if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to)
-       || NULLPTR_TYPE_P (to))
+       || tcode == NULLPTR_TYPE)
       && expr && null_ptr_cst_p (expr))
     conv = build_conv (ck_std, to, conv);
   else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE)
@@ -924,14 +924,14 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
          || UNSCOPED_ENUM_P (from)
          || fcode == POINTER_TYPE
          || TYPE_PTR_TO_MEMBER_P (from)
-         || NULLPTR_TYPE_P (from))
+         || fcode == NULLPTR_TYPE)
        {
          conv = build_conv (ck_std, to, conv);
          if (fcode == POINTER_TYPE
              || TYPE_PTRMEM_P (from)
              || (TYPE_PTRMEMFUNC_P (from)
                  && conv->rank < cr_pbool)
-             || NULLPTR_TYPE_P (from))
+              || fcode == NULLPTR_TYPE)
            conv->rank = cr_pbool;
          return conv;
        }
@@ -4517,7 +4517,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
       return cp_build_unary_op (code, arg1, candidates != 0, complain);
 
     case ARRAY_REF:
-      return cp_build_array_ref (input_location, arg1, arg2, complain);
+      return build_array_ref (input_location, arg1, arg2);
 
     case MEMBER_REF:
       return build_m_component_ref (cp_build_indirect_ref (arg1, RO_NULL, 
@@ -5209,7 +5209,7 @@ convert_arg_to_ellipsis (tree arg)
          < TYPE_PRECISION (double_type_node))
       && !DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (arg))))
     arg = convert_to_real (double_type_node, arg);
-  else if (NULLPTR_TYPE_P (TREE_TYPE (arg)))
+  else if (TREE_CODE (TREE_TYPE (arg)) == NULLPTR_TYPE)
     arg = null_pointer_node;
   else if (INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (arg)))
     arg = perform_integral_promotions (arg);
@@ -5666,7 +5666,6 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
        parm = TREE_CHAIN (parm), ++arg_index, ++i)
     {
       tree type = TREE_VALUE (parm);
-      tree arg = VEC_index (tree, args, arg_index);
 
       conv = convs[i];
 
@@ -5681,8 +5680,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
       if (cxx_dialect > cxx98
          && flag_deduce_init_list
          && cand->template_decl
-         && is_std_init_list (non_reference (type))
-         && BRACE_ENCLOSED_INITIALIZER_P (arg))
+         && is_std_init_list (non_reference (type)))
        {
          tree tmpl = TI_TEMPLATE (cand->template_decl);
          tree realparm = chain_index (j, DECL_ARGUMENTS (cand->fn));
@@ -5703,7 +5701,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
            }
        }
 
-      val = convert_like_with_context (conv, arg, fn, i-is_method, complain);
+      val = convert_like_with_context
+       (conv, VEC_index (tree, args, arg_index), fn, i - is_method,
+        complain);
 
       val = convert_for_arg_passing (type, val);
       if (val == error_mark_node)
@@ -5776,8 +5776,7 @@ 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))
-              || move_fn_p (fn))
+      else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn)))
        {
          mark_used (fn);
          already_used = true;
@@ -5795,8 +5794,7 @@ 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))
-                  && !move_fn_p (fn))
+         else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
            return build_target_expr_with_type (arg, DECL_CONTEXT (fn));
        }
       else if (TREE_CODE (arg) == TARGET_EXPR
@@ -6445,8 +6443,8 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args,
            /* This is not an error, it is runtime undefined
               behavior.  */
            warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ?
-                     "pure virtual %q#D called from constructor"
-                     : "pure virtual %q#D called from destructor"),
+                     "abstract virtual %q#D called from constructor"
+                     : "abstract virtual %q#D called from destructor"),
                     fn);
 
          if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE