diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2014-10-15 20:40:31 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2014-10-15 20:40:31 +0000 |
commit | 8a7fb87eae6a9ba8ba0a715d92912893b218512c (patch) | |
tree | 33b5bedc66d40f1b09f6963f7781b01e820cda16 /libstdc++-v3/include/debug/functions.h | |
parent | e39423c06daa6d37098d1000174587b10ce695a3 (diff) | |
download | gcc-8a7fb87eae6a9ba8ba0a715d92912893b218512c.zip gcc-8a7fb87eae6a9ba8ba0a715d92912893b218512c.tar.gz gcc-8a7fb87eae6a9ba8ba0a715d92912893b218512c.tar.bz2 |
re PR libstdc++/63500 (bug in debug version of std::make_move_iterator?)
2014-10-15 François Dumont <fdumont@gcc.gnu.org>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/63500
* include/debug/functions.h (__foreign_iterator_aux2): Do not check for
foreign iterators if input iterators returns rvalue reference.
* testsuite/23_containers/vector/63500.cc: New.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r216286
Diffstat (limited to 'libstdc++-v3/include/debug/functions.h')
-rw-r--r-- | libstdc++-v3/include/debug/functions.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libstdc++-v3/include/debug/functions.h b/libstdc++-v3/include/debug/functions.h index b48c36d..0e7f1b7 100644 --- a/libstdc++-v3/include/debug/functions.h +++ b/libstdc++-v3/include/debug/functions.h @@ -34,7 +34,7 @@ // _Iter_base #include <bits/cpp_type_traits.h> // for __is_integer #include <bits/move.h> // for __addressof and addressof -# include <bits/stl_function.h> // for less +#include <bits/stl_function.h> // for less #if __cplusplus >= 201103L # include <type_traits> // for is_lvalue_reference and __and_ #endif @@ -252,8 +252,16 @@ namespace __gnu_debug const _InputIterator& __other, const _InputIterator& __other_end) { - return __foreign_iterator_aux3(__it, __other, __other_end, - _Is_contiguous_sequence<_Sequence>()); +#if __cplusplus < 201103L + typedef _Is_contiguous_sequence<_Sequence> __tag; +#else + using __lvalref = std::is_lvalue_reference< + typename std::iterator_traits<_InputIterator>::reference>; + using __contiguous = _Is_contiguous_sequence<_Sequence>; + using __tag = typename std::conditional<__lvalref::value, __contiguous, + std::__false_type>::type; +#endif + return __foreign_iterator_aux3(__it, __other, __other_end, __tag()); } /* Handle the case where we aren't really inserting a range after all */ |