diff options
author | Paolo Carlini <pcarlini@unitus.it> | 2002-05-01 04:17:35 +0200 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2002-05-01 02:17:35 +0000 |
commit | 072a15d99be4d2c69d727aa2e8bef83951ea1243 (patch) | |
tree | d08248dcaaa115da615a21aa072e416f7ef0373d | |
parent | 08b57fb3abf6b8591b0424da9cb0c5a44f5eb55e (diff) | |
download | gcc-072a15d99be4d2c69d727aa2e8bef83951ea1243.zip gcc-072a15d99be4d2c69d727aa2e8bef83951ea1243.tar.gz gcc-072a15d99be4d2c69d727aa2e8bef83951ea1243.tar.bz2 |
re PR libstdc++/6513 (sigfaults on trivial code)
2002-05-01 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/6513
* include/bits/stl_uninitialized.h
(uninitialized_copy(_InputIter, _InputIter, _ForwardIter)):
Fix typo in 2001-07-17 commit: typedef _ValueType to
iterator_traits<_ForwardIter> not <_InputIter>.
* testsuite/23_containers/vector_ctor.cc: Add test04.
From-SVN: r52985
-rw-r--r-- | libstdc++-v3/ChangeLog | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_uninitialized.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/vector_ctor.cc | 14 |
3 files changed, 24 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7394140..ab09780 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2002-05-01 Paolo Carlini <pcarlini@unitus.it> + + PR libstdc++/6513 + * include/bits/stl_uninitialized.h + (uninitialized_copy(_InputIter, _InputIter, _ForwardIter)): + Fix typo in 2001-07-17 commit: typedef _ValueType to + iterator_traits<_ForwardIter> not <_InputIter>. + * testsuite/23_containers/vector_ctor.cc: Add test04. + 2002-04-30 John David Anglin <dave@hiauly1.hia.nrc.ca> PR libstdc++/6501 diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index 866b20b..b5f7b8c 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -107,7 +107,7 @@ namespace std inline _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result) { - typedef typename iterator_traits<_InputIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; return __uninitialized_copy_aux(__first, __last, __result, _Is_POD()); } diff --git a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc index 6ac74e7..c5caf3d 100644 --- a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc +++ b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc @@ -21,6 +21,7 @@ // 23.2.4.1 vector constructors, copy, and assignment #include <vector> +#include <string> #include <testsuite_hooks.h> template<typename T> @@ -81,11 +82,24 @@ test03() #endif } +// libstdc++/6513 +void test04() +{ + bool test = true; + const char* c_strings[5] = { "1", "2", "3", "4", "5" }; + std::vector<std::string> strings(c_strings, c_strings + 5); + +#ifdef DEBUG_ASSERT + assert(test); +#endif +} + int main() { test01(); test02(); test03(); + test04(); return 0; } |