OSDN Git Service

PR c++/49418
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jun 2011 02:18:42 +0000 (02:18 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jun 2011 02:18:42 +0000 (02:18 +0000)
* typeck2.c (build_functional_cast): Strip cv-quals for value init.
* init.c (build_zero_init_1): Not here.

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

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/cp/typeck2.c

index e00b400..12b12e5 100644 (file)
@@ -1,5 +1,9 @@
 2011-06-23  Jason Merrill  <jason@redhat.com>
 
+       PR c++/49519
+       * typeck2.c (build_functional_cast): Strip cv-quals for value init.
+       * init.c (build_zero_init_1): Not here.
+
        PR c++/35255
        * pt.c (resolve_overloaded_unification): Fix DR 115 handling.
 
index 62b68f2..3c347a4 100644 (file)
@@ -176,7 +176,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
        initialized are initialized to zero.  */
     ;
   else if (SCALAR_TYPE_P (type))
-    init = convert (cv_unqualified (type), integer_zero_node);
+    init = convert (type, integer_zero_node);
   else if (CLASS_TYPE_P (type))
     {
       tree field;
index ff2949c..8bb938e 100644 (file)
@@ -1641,7 +1641,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
        {
          if (VOID_TYPE_P (type))
            return void_zero_node;
-         return build_value_init (type, complain);
+         return build_value_init (cv_unqualified (type), complain);
        }
 
       /* This must build a C cast.  */