mirror of git://gcc.gnu.org/git/gcc.git
stl_algobase.h (__miter_base): Move...
2015-07-16 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_algobase.h (__miter_base): Move... * include/bits/cpp_type_traits.h: ...here. * include/debug/functions.h (__foreign_iterator_aux): Use latter. * testsuite/23_containers/vector/debug/insert7_neg.cc: New. From-SVN: r225902
This commit is contained in:
parent
a4cb876dc9
commit
5bc1c07c4a
|
|
@ -1,3 +1,10 @@
|
||||||
|
2015-07-16 François Dumont <fdumont@gcc.gnu.org>
|
||||||
|
|
||||||
|
* include/bits/stl_algobase.h (__miter_base): Move...
|
||||||
|
* include/bits/cpp_type_traits.h: ...here.
|
||||||
|
* include/debug/functions.h (__foreign_iterator_aux): Use latter.
|
||||||
|
* testsuite/23_containers/vector/debug/insert7_neg.cc: New.
|
||||||
|
|
||||||
2015-07-13 Jonathan Wakely <jwakely@redhat.com>
|
2015-07-13 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/66855
|
PR libstdc++/66855
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,13 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3)
|
||||||
typedef __false_type __type;
|
typedef __false_type __type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Fallback implementation of the function in bits/stl_iterator.h used to
|
||||||
|
// remove the move_iterator wrapper.
|
||||||
|
template<typename _Iterator>
|
||||||
|
inline _Iterator
|
||||||
|
__miter_base(_Iterator __it)
|
||||||
|
{ return __it; }
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_VERSION
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,12 +277,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
__niter_base(_Iterator __it)
|
__niter_base(_Iterator __it)
|
||||||
{ return __it; }
|
{ return __it; }
|
||||||
|
|
||||||
// Likewise for move_iterator.
|
|
||||||
template<typename _Iterator>
|
|
||||||
inline _Iterator
|
|
||||||
__miter_base(_Iterator __it)
|
|
||||||
{ return __it; }
|
|
||||||
|
|
||||||
// All of these auxiliary structs serve two purposes. (1) Replace
|
// All of these auxiliary structs serve two purposes. (1) Replace
|
||||||
// calls to copy with memmove whenever possible. (Memmove, not memcpy,
|
// calls to copy with memmove whenever possible. (Memmove, not memcpy,
|
||||||
// because the input and output ranges are permitted to overlap.)
|
// because the input and output ranges are permitted to overlap.)
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,8 @@ namespace __gnu_debug
|
||||||
std::__false_type)
|
std::__false_type)
|
||||||
{
|
{
|
||||||
return _Insert_range_from_self_is_safe<_Sequence>::__value
|
return _Insert_range_from_self_is_safe<_Sequence>::__value
|
||||||
|| __foreign_iterator_aux2(__it, __other, __other_end);
|
|| __foreign_iterator_aux2(__it, std::__miter_base(__other),
|
||||||
|
std::__miter_base(__other_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Iterator, typename _Sequence,
|
template<typename _Iterator, typename _Sequence,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
// -*- C++ -*-
|
||||||
|
|
||||||
|
// Copyright (C) 2015 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 3, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING3. If not see
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// { dg-options "-std=gnu++11" }
|
||||||
|
// { dg-do run { xfail *-*-* } }
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <iterator>
|
||||||
|
#include <debug/vector>
|
||||||
|
|
||||||
|
void
|
||||||
|
test01()
|
||||||
|
{
|
||||||
|
__gnu_debug::vector<std::unique_ptr<int>> v;
|
||||||
|
|
||||||
|
v.emplace_back(new int(0));
|
||||||
|
v.emplace_back(new int(1));
|
||||||
|
|
||||||
|
v.insert(begin(v) + 1,
|
||||||
|
make_move_iterator(begin(v)),
|
||||||
|
make_move_iterator(end(v)));
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
test01();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue