OSDN Git Service

PR c++/29043
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Apr 2010 00:03:21 +0000 (00:03 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:36:42 +0000 (14:36 +0900)
* init.c (perform_member_init): check for uninitialized const or
reference members, including array types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158817 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog

index 1b5ea4b..5b31277 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-27  Fabien ChĂȘne  <fabien.chene@gmail.com>
+
+       PR c++/29043
+       * init.c (perform_member_init): check for uninitialized const or
+       reference members, including array types.
+
 2010-04-24  Jason Merrill  <jason@redhat.com>
 
        * tree.c (get_fns): Split out from get_first_fn.
index cb56d9c..57b874d 100644 (file)
@@ -518,12 +518,9 @@ perform_member_init (tree member, tree init)
                       member, type);
 
          core_type = strip_array_types (type);
-         if (CLASS_TYPE_P (core_type)
-             && (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)
-                 || CLASSTYPE_REF_FIELDS_NEED_INIT (core_type)))
-           diagnose_uninitialized_cst_or_ref_member (core_type,
-                                                     /*using_new=*/false,
-                                                     /*complain=*/true);
+         if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)
+             || CLASSTYPE_REF_FIELDS_NEED_INIT (core_type))
+           diagnose_uninitialized_cst_or_ref_member (core_type, /*using_new=*/false);
        }
       else if (TREE_CODE (init) == TREE_LIST)
        /* There was an explicit member initialization.  Do some work
@@ -2463,7 +2460,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));
     }
 
@@ -3119,8 +3115,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;
index d8d1cd3..5277e71 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-27  Fabien ChĂȘne  <fabien.chene@gmail.com>
+
+       PR c++/29043
+       * g++.dg/init/pr29043.C: New.
+
 2010-04-27  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/lookup/scoped5.C: Adjust.