typeck2.c (split_nonconstant_init_1): Fix num_split_elts handling for RANGE_ARRAY...
authorJakub Jelinek <jakub@redhat.com>
Fri, 24 Jan 2014 16:47:31 +0000 (17:47 +0100)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 24 Jan 2014 16:47:31 +0000 (11:47 -0500)
* typeck2.c (split_nonconstant_init_1): Fix num_split_elts
handling for RANGE_ARRAY case.

From-SVN: r207050

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

index d9098b48ba42e1f3d5cf55251890df7e16930848..d9f023a7290b655d517240ddbc9ef138f1ddcf33 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+       * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
+       handling for RANGE_ARRAY case.
+
 2014-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/57524
index 25edbacce96e85d51a4766803974ec05308eb0b7..897570ad3a2cf2272256b45e85135404ff4bbca9 100644 (file)
@@ -643,6 +643,8 @@ split_nonconstant_init_1 (tree dest, tree init)
                  code = build_vec_init (sub, max, value, false, 0,
                                         tf_warning_or_error);
                  add_stmt (code);
+                 if (tree_fits_shwi_p (max))
+                   num_split_elts += tree_to_shwi (max);
                }
              else
                {