Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.tcc (reserve): Allow shrink-to-fit.
* testsuite/21_strings/basic_string/capacity/1.cc: Tweak.
* testsuite/21_strings/basic_string/capacity/char/1.cc: Ditto.
* testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74551
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-12-11 Neil Ferguson <nferguso@eso.org>
+ Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/basic_string.tcc (reserve): Allow shrink-to-fit.
+ * testsuite/21_strings/basic_string/capacity/1.cc: Tweak.
+ * testsuite/21_strings/basic_string/capacity/char/1.cc: Ditto.
+ * testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Ditto.
+
2003-12-10 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6243
void
basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res)
{
- if (__res > this->capacity() || _M_rep()->_M_is_shared())
+ if (__res != this->capacity() || _M_rep()->_M_is_shared())
{
if (__res > this->max_size())
__throw_length_error("basic_string::reserve");
VERIFY( sz04 >= 100 );
str02.reserve();
sz03 = str02.capacity();
- VERIFY( sz03 > 0 );
+ VERIFY( sz03 >= 0 );
sz03 = str02.size() + 5;
str02.resize(sz03);
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 > 0 );
+ VERIFY( sz01 >= 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 > 0 );
+ VERIFY( sz01 >= 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);