2002-06-04 Paolo Carlini <pcarlini@unitus.it>
Gaby Dos Reis <gdr@codesourcery.com> * include/bits/basic_string.tcc (basic_string::_S_construct(forward_iterator_tag): Fix typo in null pointer check. * testsuite/21_strings/ctor_copy_dtor.cc: Add test04. Co-Authored-By: Gabriel Dos Reis <gdr@codesourcery.com> From-SVN: r54255
This commit is contained in:
parent
1ba7b41497
commit
05261e700c
@ -1,3 +1,11 @@
|
||||
2002-06-04 Paolo Carlini <pcarlini@unitus.it>
|
||||
Gaby Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
* include/bits/basic_string.tcc
|
||||
(basic_string::_S_construct(forward_iterator_tag):
|
||||
Fix typo in null pointer check.
|
||||
* testsuite/21_strings/ctor_copy_dtor.cc: Add test04.
|
||||
|
||||
2002-06-04 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
* testsuite/22_locale/money_get_members_char.cc
|
||||
|
@ -140,7 +140,7 @@ namespace std
|
||||
size_type __dnew = static_cast<size_type>(distance(__beg, __end));
|
||||
|
||||
// NB: Not required, but considered best practice.
|
||||
if (__builtin_expect(__beg == _InIter(0), 0))
|
||||
if (__builtin_expect(__beg == _InIter(), 0))
|
||||
__throw_logic_error("attempt to create string with null pointer");
|
||||
|
||||
if (__beg == __end && __a == _Alloc())
|
||||
|
@ -201,11 +201,25 @@ void test03()
|
||||
}
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html
|
||||
void test04()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
std::string str01("portofino");
|
||||
|
||||
std::string::reverse_iterator i1 = str01.rbegin();
|
||||
std::string::reverse_iterator i2 = str01.rend();
|
||||
std::string str02(i1, i2);
|
||||
VERIFY( str02 == "onifotrop" );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
__set_testsuite_memlimit();
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
test04();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user