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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54255
138bc75d-0d04-0410-961f-
82ee72b054a4
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
(test02): Add decimal point to long double constants.
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())
}
}
+// 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;
}