]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stl_vector.h (vector(size_type)): Add missing allocator parameter.
authorJonathan Wakely <jwakely.gcc@gmail.com>
Wed, 7 Nov 2012 09:17:42 +0000 (09:17 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 7 Nov 2012 09:17:42 +0000 (09:17 +0000)
* include/bits/stl_vector.h (vector(size_type)): Add missing allocator
parameter.
* include/bits/stl_bvector.h: Likewise.
* include/debug/vector (vector(size_type)): Likewise.
* include/profile/vector (vector(size_type)): Likewise. Pass allocator
to base constructor.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.

From-SVN: r193284

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/debug/vector
libstdc++-v3/include/profile/vector
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc

index 184efed35253ac898ca726043a88e546b6c2537f..233f2b96b5b207d48c7a6e2215d3c400b9e16cc7 100644 (file)
@@ -1,3 +1,20 @@
+2012-11-07  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * include/bits/stl_vector.h (vector(size_type)): Add missing allocator
+       parameter.
+       * include/bits/stl_bvector.h: Likewise.
+       * include/debug/vector (vector(size_type)): Likewise.
+       * include/profile/vector (vector(size_type)): Likewise. Pass allocator
+       to base constructor.
+       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line numbers.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+       Likewise.
+
 2012-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/51850
index 3adbfa1ddf2f217542b163bad6cbf39b0a4937e6..b8d3efbf6511135669625f4140583a4302c8557b 100644 (file)
@@ -555,6 +555,21 @@ template<typename _Alloc>
     vector(const allocator_type& __a)
     : _Base(__a) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+    explicit
+    vector(size_type __n, const allocator_type& __a = allocator_type())
+    : vector(__n, false, __a)
+    { }
+
+    vector(size_type __n, const bool& __value, 
+          const allocator_type& __a = allocator_type())
+    : _Base(__a)
+    {
+      _M_initialize(__n);
+      std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage, 
+               __value ? ~0 : 0);
+    }
+#else
     explicit
     vector(size_type __n, const bool& __value = bool(), 
           const allocator_type& __a = allocator_type())
@@ -564,6 +579,7 @@ template<typename _Alloc>
       std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage, 
                __value ? ~0 : 0);
     }
+#endif
 
     vector(const vector& __x)
     : _Base(__x._M_get_Bit_allocator())
index 6e229aa9df2d6c1967ee7c7ba174f507dc78012a..1f14f7eda7ec6a12c0cd9fff6ec0a6b1bb750862 100644 (file)
@@ -261,13 +261,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /**
        *  @brief  Creates a %vector with default constructed elements.
        *  @param  __n  The number of elements to initially create.
+       *  @param  __a  An allocator.
        *
        *  This constructor fills the %vector with @a __n default
        *  constructed elements.
        */
       explicit
-      vector(size_type __n)
-      : _Base(__n)
+      vector(size_type __n, const allocator_type& __a = allocator_type())
+      : _Base(__n, __a)
       { _M_default_initialize(__n); }
 
       /**
index 9c33fdf69f9087e87e69f34a122da20dbb95bb7c..fe65bab0c7a3aca73372fe73958ea060f3c8c6d6 100644 (file)
@@ -83,8 +83,8 @@ namespace __debug
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       explicit
-      vector(size_type __n)
-      : _Base(__n), _M_guaranteed_capacity(__n) { }
+      vector(size_type __n, const _Allocator& __a = _Allocator())
+      : _Base(__n, __a), _M_guaranteed_capacity(__n) { }
 
       vector(size_type __n, const _Tp& __value,
             const _Allocator& __a = _Allocator())
index fcd6962799556a12d3f379af67882a68dfe8f22c..ec931a3bd91a151f04583fa1c0ed8a96cda1ec3e 100644 (file)
@@ -84,8 +84,8 @@ namespace __profile
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       explicit
-      vector(size_type __n)
-      : _Base(__n)
+      vector(size_type __n, const _Allocator& __a = _Allocator())
+      : _Base(__n, __a)
       {
         __profcxx_vector_construct(this, this->capacity());
         __profcxx_vector_construct2(this);
@@ -147,7 +147,7 @@ namespace __profile
       }
 
       vector(const _Base& __x, const _Allocator& __a)
-      : _Base(__x
+      : _Base(__x, __a)
       { 
         __profcxx_vector_construct(this, this->capacity());
         __profcxx_vector_construct2(this);
index 320f4dd0d693b1a8deb032fa4e2bfb6ed15fbe03..8c009891f5f76190fad31818759a57db9baaf264 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1236 }
+// { dg-error "no matching" "" { target *-*-* } 1237 }
 
 #include <vector>
 
index 78a6ead9be8ebd95065acbd1d83506e736fd1932..e5a46445782903beb5eb044bd9db658477f7495d 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1166 }
+// { dg-error "no matching" "" { target *-*-* } 1167 }
 
 #include <vector>
 
index af12c6d08f89b61db2d2802402c4b790e170b9dd..9e2924c2f235b2601f17899e2191bbd1362408b0 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1166 }
+// { dg-error "no matching" "" { target *-*-* } 1167 }
 
 #include <vector>
 #include <utility>
index da881801c102f835870d844bb6c6d72fc9d25fc4..e4bec2668e7c7a3c990ccb01c82d3bdafb242bcf 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1277 }
+// { dg-error "no matching" "" { target *-*-* } 1278 }
 
 #include <vector>