OSDN Git Service

PR c++/43890
[pf3gnuchains/gcc-fork.git] / gcc / cp / init.c
index a2d9837..70e3d38 100644 (file)
@@ -1911,13 +1911,13 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
 
   is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || *init != NULL);
 
-  if (*init == NULL && !type_has_user_provided_constructor (elt_type))
+  if (*init == NULL)
     {
-      bool uninitialized_error = false;
+      bool maybe_uninitialized_error = false;
       /* A program that calls for default-initialization [...] of an
         entity of reference type is ill-formed. */
       if (CLASSTYPE_REF_FIELDS_NEED_INIT (elt_type))
-       uninitialized_error = true;
+       maybe_uninitialized_error = true;
 
       /* A new-expression that creates an object of type T initializes
         that object as follows:
@@ -1932,9 +1932,9 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
           const-qualified type, the program is ill-formed; */
 
       if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (elt_type))
-       uninitialized_error = true;
+       maybe_uninitialized_error = true;
 
-      if (uninitialized_error)
+      if (maybe_uninitialized_error)
        {
          if (complain & tf_error)
            diagnose_uninitialized_cst_or_ref_member (elt_type,
@@ -2465,7 +2465,6 @@ build_new (VEC(tree,gc) **placement, tree type, tree nelts,
           else
             return error_mark_node;
         }
-      nelts = mark_rvalue_use (nelts);
       nelts = cp_save_expr (cp_convert (sizetype, nelts));
     }
 
@@ -3121,8 +3120,6 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
 
   type = TYPE_MAIN_VARIANT (type);
 
-  addr = mark_rvalue_use (addr);
-
   if (TREE_CODE (type) == POINTER_TYPE)
     {
       bool complete_p = true;