Commit 072a15d9 by Paolo Carlini Committed by Paolo Carlini

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
parent 08b57fb3
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
......
......@@ -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());
}
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment