gcc/libstdc++-v3/include/debug/macros.h

456 lines
20 KiB
C
Raw Normal View History

// Debugging support implementation -*- C++ -*-
// Copyright (C) 2003-2020 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.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
throw_allocator.h: Consistent @file markup. 2006-11-29 Benjamin Kosnik <bkoz@redhat.com> * include/ext/throw_allocator.h: Consistent @file markup. * include/ext/type_traits.h: Same. * include/debug/hash_map: Same. * include/debug/hash_multimap.h: Same. * include/debug/set.h: Same. * include/debug/hash_set.h: Same. * include/debug/formatter.h: Same. * include/debug/bitset: Same. * include/debug/set: Same. * include/debug/multiset.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/hash_set: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/safe_iterator.tcc: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/hash_map.h: Same. * include/debug/string: Same. * include/debug/macros.h: Same. * include/debug/list: Same. * include/debug/debug.h: Same. * include/debug/map: Same. * include/debug/safe_iterator.h: Same. * include/debug/multimap.h: Same. * config/cpu/generic/atomicity_mutex/atomicity.h: Same. * config/cpu/generic/atomicity_builtins/atomicity.h: Same. * config/cpu/generic/atomic_word.h: Same. * include/tr1/memory: Same. * include/tr1/random: Same. * include/std/std_queue.h: Same. * include/std/std_iterator.h: Same. * include/std/std_bitset.h: Same. * include/std/std_set.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * libsupc++/typeinfo: Same. * libsupc++/exception: Same. * libsupc++/exception_defines.h: Same. * libsupc++/new: Same. * include/ext/bitmap_allocator.h: Change namespace __balloc to __detail. * src/bitmap_allocator.cc: Same. * include/bits/cpp_type_traits.h: Change __true_type and __false_type from global to namespace std scope. * include/ext/slist: Same. * include/ext/vstring.h: Same. * include/ext/vstring.tcc: Same. * include/ext/rc_string_base.h: Same. * include/ext/sso_string_base.h: Same. * include/bits/codecvt.h: Adjust markup so that correct namespace scope information is in all files. * include/bits/locale_facets.h: Same. Include ctype_base directly. * config/os/windiss/ctype_base.h: Add in namespace markup. * config/os/newlib/ctype_base.h: Same. * config/os/aix/ctype_base.h: Same. * config/os/vxworks/ctype_base.h: Same. * config/os/hpux/ctype_base.h: Same. * config/os/mingw32/ctype_base.h: Same. * config/os/gnu-linux/ctype_base.h: Same. * config/os/tpf/ctype_base.h: Same. * config/os/uclibc/ctype_base.h: Same. * config/os/djgpp/ctype_base.h: Same. * config/os/qnx/qnx6.1/ctype_base.h: Same. * config/os/bsd/netbsd/ctype_base.h: Same. * config/os/bsd/darwin/ctype_base.h: Same. * config/os/bsd/freebsd/ctype_base.h: Same. * config/os/irix/irix5.2/ctype_base.h: Same. * config/os/irix/irix6.5/ctype_base.h: Same. * config/os/solaris/solaris2.5/ctype_base.h: Same. * config/os/solaris/solaris2.6/ctype_base.h: Same. * config/os/solaris/solaris2.7/ctype_base.h: Same. * config/os/generic/ctype_base.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/tuple: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Line number changes. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * docs/doxygen/user.cfg.in: Update to doxygen 1.5.1. * docs/html/17_intro/license.html: Updated info for generated docs. * docs/doxygen/guide.html: Adjust. * docs/doxygen/run_doxygen: Adjust. * docs/doxygen/mainpage.html: Same. * docs/doxygen/doxygroups.cc: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/tables.html: Same. From-SVN: r119334
2006-11-29 21:59:22 +01:00
/** @file debug/macros.h
* This file is a GNU debug extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_DEBUG_MACROS_H
#define _GLIBCXX_DEBUG_MACROS_H 1
/**
* Macros used by the implementation to verify certain
* properties. These macros may only be used directly by the debug
* wrappers. Note that these are macros (instead of the more obviously
re PR libstdc++/42460 (man page errors for generated libstdc++ man pages) 2010-02-04 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/42460 * doc/doxygen/user.cfg.in: Update file list. * include/debug/safe_sequence.h: Doxygen markup fixes for '' and "". * include/debug/safe_base.h: Same. * include/debug/macros.h: Same. * include/tr1_impl/regex: Same. * include/std/iostream: Same. * include/std/streambuf: Same. * include/std/bitset: Same. * include/std/iosfwd: Same. * include/std/limits: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/parallel/multiway_merge.h: Same. * include/parallel/for_each.h: Same. * include/parallel/workstealing.h: Same. * include/parallel/omp_loop_static.h: Same. * include/parallel/omp_loop.h: Same. * include/c_std/csignal: Same. * include/c_std/cstdlib: Same. * include/c_std/cstdio: Same. * include/c_std/cstdarg: Same. * include/c_std/cctype: Same. * include/c_std/cerrno: Same. * include/c_std/cmath: Same. * include/c_std/ciso646: Same. * include/c_std/ctime: Same. * include/c_std/clocale: Same. * include/c_std/climits: Same. * include/c_std/cassert: Same. * include/c_std/csetjmp: Same. * include/c_std/cwchar: Same. * include/c_std/cfloat: Same. * include/c_std/cstring: Same. * include/c_std/cstddef: Same. * include/c_std/cwctype: Same. * include/profile/iterator_tracker.h: Same. * include/profile/impl/profiler_trace.h: Same. * include/ext/vstring.h: Same. * include/ext/algorithm: Same. * include/ext/pb_ds/detail/pat_trie_/pat_trie_.h.pp: Same. * include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.h.pp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same * include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same. * include/ext/rc_string_base.h: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/functional: Same. * include/ext/mt_allocator.h: Same. * include/bits/basic_ios.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/stl_queue.h: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/random.tcc: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/random.h: Same. * include/bits/allocator.h: Same. * include/bits/locale_facets_nonio.h: Same. * include/c_global/csignal: Same. * include/c_global/cstdlib: Same. * include/c_global/cstdio: Same. * include/c_global/cstdarg: Same. * include/c_global/cctype: Same. * include/c_global/cerrno: Same. * include/c_global/cmath: Same. * include/c_global/ciso646: Same. * include/c_global/ctime: Same. * include/c_global/clocale: Same. * include/c_global/climits: Same. * include/c_global/cassert: Same. * include/c_global/csetjmp: Same. * include/c_global/cwchar: Same. * include/c_global/cfloat: Same. * include/c_global/cstring: Same. * include/c_global/cstddef: Same. * include/c_global/cwctype: Same. * include/tr1/hypergeometric.tcc: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/random.h: Same. * include/backward/auto_ptr.h: Same. * include/backward/binders.h: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust line numbers. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc: Same. From-SVN: r156502
2010-02-04 19:20:34 +01:00
* @a correct choice of making them functions) because we need line and
* file information at the call site, to minimize the distance between
* the user error and where the error is reported.
*
*/
libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible libstdc++-v3/ChangeLog: * include/debug/assertions.h (__glibcxx_requires_non_empty_range): Remove __builtin_expect. (__glibcxx_requires_subscript): Likewise. (__glibcxx_requires_nonempty): Likewise. * include/debug/formatter.h (__check_singular): Add C++11 constexpr qualification. * include/debug/helper_functions.h (__check_singular): Likewise. Skip check if constant evaluated. (__valid_range): Do not skip check if constant evaluated. * include/debug/macros.h (_GLIBCXX_DEBUG_VERIFY_COND_AT): Add __builtin_expect. (_GLIBCXX_DEBUG_VERIFY_AT_F): Use __glibcxx_assert_1. * testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/front_back_constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc: New test.
2020-01-21 19:12:29 +01:00
#define _GLIBCXX_DEBUG_VERIFY_COND_AT(_Cond,_ErrMsg,_File,_Line,_Func) \
if (__builtin_expect(!bool(_Cond), false)) \
__gnu_debug::_Error_formatter::_S_at(_File, _Line, _Func) \
._ErrMsg._M_error()
#define _GLIBCXX_DEBUG_VERIFY_AT_F(_Cond,_ErrMsg,_File,_Line,_Func) \
libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible libstdc++-v3/ChangeLog: * include/debug/assertions.h (__glibcxx_requires_non_empty_range): Remove __builtin_expect. (__glibcxx_requires_subscript): Likewise. (__glibcxx_requires_nonempty): Likewise. * include/debug/formatter.h (__check_singular): Add C++11 constexpr qualification. * include/debug/helper_functions.h (__check_singular): Likewise. Skip check if constant evaluated. (__valid_range): Do not skip check if constant evaluated. * include/debug/macros.h (_GLIBCXX_DEBUG_VERIFY_COND_AT): Add __builtin_expect. (_GLIBCXX_DEBUG_VERIFY_AT_F): Use __glibcxx_assert_1. * testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/front_back_constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc: New test. * testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc: New test. * testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc: New test. * testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc: New test.
2020-01-21 19:12:29 +01:00
do { \
__glibcxx_assert_1(_Cond) \
{ _GLIBCXX_DEBUG_VERIFY_COND_AT(_Cond,_ErrMsg,_File,_Line,_Func); } \
} while (false)
#define _GLIBCXX_DEBUG_VERIFY_AT(_Cond,_ErrMsg,_File,_Line) \
_GLIBCXX_DEBUG_VERIFY_AT_F(_Cond,_ErrMsg,_File,_Line,__PRETTY_FUNCTION__)
#define _GLIBCXX_DEBUG_VERIFY(_Cond,_ErrMsg) \
_GLIBCXX_DEBUG_VERIFY_AT_F(_Cond, _ErrMsg, __FILE__, __LINE__, \
__PRETTY_FUNCTION__)
macro.h (_GLIBCXX_DEBUG_VERIFY_AT): New. 2011-05-07 François Dumont <francois.cppdevs@free.fr> * include/debug/macro.h (_GLIBCXX_DEBUG_VERIFY_AT): New. (_GLICXX_DEBUG_VERIFY): Use latter. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Emit assertion on the line containing the original assert call. * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp, find_fn_imps.hpp, insert_fn_imps.hpp, binomial_heap_base_.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp, insert_no_store_hash_fn_imps.hpp, find_fn_imps.hpp, insert_store_hash_fn_imps.hpp, debug_fn_imps.hpp, debug_no_store_hash_fn_imps.hpp, cc_ht_map_.hpp, resize_fn_imps.hpp, constructor_destructor_fn_imps.hpp, debug_store_hash_fn_imps.hpp, erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp, insert_join_fn_imps.hpp, pat_trie_/head.hpp, debug_fn_imps.hpp, constructors_destructor_fn_imps.hpp, pat_trie_.hpp, split_fn_imps.hpp, leaf.hpp, erase_fn_imps.hpp, node_base.hpp, internal_node.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp, r_erase_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, rotate_fn_imps.hpp, erase_fn_imps.hpp, bin_search_tree_.hpp, insert_fn_imps.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ erase_store_hash_fn_imps.hpp, insert_no_store_hash_fn_imps.hpp, find_fn_imps.hpp, gp_ht_map_.hpp, insert_store_hash_fn_imps.hpp, debug_fn_imps.hpp, erase_fn_imps.hpp, debug_no_store_hash_fn_imps.hpp, resize_fn_imps.hpp, constructor_destructor_fn_imps.hpp, debug_store_hash_fn_imps.hpp, erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, erase_fn_imps.hpp, insert_fn_imps.hpp, binary_heap_.hpp, resize_policy.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp, find_fn_imps.hpp, insert_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, pairing_heap_.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_/ constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, binomial_heap_.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp, left_child_next_sibling_heap_.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp, find_fn_imps.hpp, thin_heap_.hpp, insert_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp, ov_tree_map_.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, split_join_fn_imps.hpp, info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp, find_fn_imps.hpp, insert_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, splay_fn_imps.hpp, split_join_fn_imps.hpp, splay_tree_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp, find_fn_imps.hpp, lu_map_.hpp, constructor_destructor_fn_imps.hpp, insert_fn_imps.hpp, debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp, rc_binomial_heap_.hpp, insert_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, rc.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp, insert_fn_imps.hpp, constructors_destructor_fn_imps.hpp, debug_fn_imps.hpp, rb_tree_.hpp, split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. From-SVN: r173529
2011-05-07 15:45:24 +02:00
// Verify that [_First, _Last) forms a valid iterator range.
#define __glibcxx_check_valid_range(_First,_Last) \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last), \
_M_message(__gnu_debug::__msg_valid_range) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
macros.h (__glibcxx_check_valid_range_at): New. 2018-05-08 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h (__glibcxx_check_valid_range_at): New. * include/debug/functions.h (__check_valid_range): Use latter. * include/debug/macros.h (__glibcxx_check_valid_constructor_range): New, use latter. * include/debug/deque (deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. * include/debug/forward_list (forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/map.h (map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multimap.h (multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/set.h (set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multiset.h (multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/string (basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_map (unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_set (unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/vector (vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. From-SVN: r260053
2018-05-08 21:46:59 +02:00
#define __glibcxx_check_valid_range_at(_First,_Last,_File,_Line,_Func) \
_GLIBCXX_DEBUG_VERIFY_AT_F(__gnu_debug::__valid_range(_First, _Last), \
_M_message(__gnu_debug::__msg_valid_range) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last), \
_File,_Line,_Func)
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
#define __glibcxx_check_valid_range2(_First,_Last,_Dist) \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last, _Dist), \
_M_message(__gnu_debug::__msg_valid_range) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
macros.h (__glibcxx_check_valid_range_at): New. 2018-05-08 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h (__glibcxx_check_valid_range_at): New. * include/debug/functions.h (__check_valid_range): Use latter. * include/debug/macros.h (__glibcxx_check_valid_constructor_range): New, use latter. * include/debug/deque (deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. * include/debug/forward_list (forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/map.h (map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multimap.h (multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/set.h (set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multiset.h (multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/string (basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_map (unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_set (unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/vector (vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. From-SVN: r260053
2018-05-08 21:46:59 +02:00
#define __glibcxx_check_valid_constructor_range(_First,_Last) \
__gnu_debug::__check_valid_range(_First, _Last, \
__FILE__, __LINE__, __PRETTY_FUNCTION__)
// Verify that [_First, _Last) forms a non-empty iterator range.
#define __glibcxx_check_non_empty_range(_First,_Last) \
_GLIBCXX_DEBUG_VERIFY(_First != _Last, \
_M_message(__gnu_debug::__msg_non_empty_range) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
// Verify that [_First, _First + _Size) forms a valid range.
#define __glibcxx_check_can_increment(_First,_Size) \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__can_advance(_First, _Size), \
_M_message(__gnu_debug::__msg_iter_subscript_oob) \
._M_iterator(_First, #_First) \
._M_integer(_Size, #_Size))
#define __glibcxx_check_can_increment_range(_First1,_Last1,_First2) \
do \
{ \
typename __gnu_debug::_Distance_traits<__decltype(_First1)>::__type __dist;\
_GLIBCXX_DEBUG_VERIFY_COND_AT( \
__gnu_debug::__valid_range(_First1, _Last1, __dist),\
_M_message(__gnu_debug::__msg_valid_range) \
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1), \
__FILE__,__LINE__,__PRETTY_FUNCTION__); \
_GLIBCXX_DEBUG_VERIFY_COND_AT( \
__gnu_debug::__can_advance(_First2, __dist.first),\
_M_message(__gnu_debug::__msg_iter_subscript_oob)\
._M_iterator(_First2, #_First2) \
._M_integer(__dist.first), \
__FILE__,__LINE__,__PRETTY_FUNCTION__); \
} while(false)
#define __glibcxx_check_can_decrement_range(_First1,_Last1,_First2) \
do \
{ \
typename __gnu_debug::_Distance_traits<__decltype(_First1)>::__type __dist;\
_GLIBCXX_DEBUG_VERIFY_COND_AT( \
__gnu_debug::__valid_range(_First1, _Last1, __dist),\
_M_message(__gnu_debug::__msg_valid_range) \
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1), \
__FILE__,__LINE__,__PRETTY_FUNCTION__); \
_GLIBCXX_DEBUG_VERIFY_COND_AT( \
__gnu_debug::__can_advance(_First2, -__dist.first),\
_M_message(__gnu_debug::__msg_iter_subscript_oob)\
._M_iterator(_First2, #_First2) \
._M_integer(-__dist.first), \
__FILE__,__LINE__,__PRETTY_FUNCTION__); \
} while(false)
/** Verify that we can insert into *this with the iterator _Position.
* Insertion into a container at a specific position requires that
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
* the iterator be nonsingular, either dereferenceable or past-the-end,
* and that it reference the sequence we are inserting into. Note that
* this macro is only valid when the container is a_Safe_sequence and
* the iterator is a _Safe_iterator.
*/
#define __glibcxx_check_insert(_Position) \
_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
_M_message(__gnu_debug::__msg_insert_singular) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
_M_message(__gnu_debug::__msg_insert_different) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
/** Verify that we can insert into *this after the iterator _Position.
* Insertion into a container after a specific position requires that
* the iterator be nonsingular, either dereferenceable or before-begin,
* and that it reference the sequence we are inserting into. Note that
* this macro is only valid when the container is a_Safe_sequence and
* the iterator is a _Safe_iterator.
*/
#define __glibcxx_check_insert_after(_Position) \
__glibcxx_check_insert(_Position); \
_GLIBCXX_DEBUG_VERIFY(!_Position._M_is_end(), \
_M_message(__gnu_debug::__msg_insert_after_end) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
/** Verify that we can insert the values in the iterator range
* [_First, _Last) into *this with the iterator _Position. Insertion
* into a container at a specific position requires that the iterator
* be nonsingular (i.e., either dereferenceable or past-the-end),
* that it reference the sequence we are inserting into, and that the
* iterator range [_First, _Last) is a valid (possibly empty)
* range which does not reference the sequence we are inserting into.
* Note that this macro is only valid when the container is a
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
* _Safe_sequence and the _Position iterator is a _Safe_iterator.
*/
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
#define __glibcxx_check_insert_range(_Position,_First,_Last,_Dist) \
__glibcxx_check_valid_range2(_First,_Last,_Dist); \
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
__glibcxx_check_insert(_Position); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__foreign_iterator(_Position,_First,_Last),\
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
_M_message(__gnu_debug::__msg_insert_range_from_self)\
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_sequence(*this, "this"))
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
/** Verify that we can insert the values in the iterator range
* [_First, _Last) into *this after the iterator _Position. Insertion
* into a container after a specific position requires that the iterator
* be nonsingular (i.e., either dereferenceable or past-the-end),
* that it reference the sequence we are inserting into, and that the
* iterator range [_First, _Last) is a valid (possibly empty)
* range which does not reference the sequence we are inserting into.
* Note that this macro is only valid when the container is a
* _Safe_sequence and the _Position iterator is a _Safe_iterator.
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
*/
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
#define __glibcxx_check_insert_range_after(_Position,_First,_Last,_Dist)\
__glibcxx_check_valid_range2(_First,_Last,_Dist); \
__glibcxx_check_insert_after(_Position); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__foreign_iterator(_Position,_First,_Last),\
re PR libstdc++/57779 (vector insert fails to diagnose iterators pointing into *this in debug mode) 2013-08-01 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/57779 * include/debug/formatter.h (_Debug_msg_id): Add __msg_insert_itself_range entry. * include/debug/functions.h (_Insert_range_from_self_is_safe<>): New, indicate container types supporting self range insertion in GNU implementation. (__foreign_iterator): New, check if an iterator points to a given sequence. * include/debug/macros.h (__glibcxx_check_insert_range): Add check using __foreign_iterator. (__gibcxx_check_insert_range_after): Likewise. * include/debug/string (_Insert_range_from_self_is_safe<>): Partially specialized to mark __gnu_debug::basic_string<> as supporting self range insert. * include/debug/list (_Insert_range_from_self_is_safe<>): Partially specialized to mark std::list as supporting self range insert if _GLIBCXX_DEBUG_PEDANTIC is not defined. * include/debug/forward_list (_Insert_range_from_self_is_safe<>): Likewise. * src/c++11/debug.cc (_S_debug_messages): Add __msg_insert_itself_range_entry message. (_Error_formatter::_Parameter::_M_print_description): Display iterator sequence address rather than sequence address when the parameter type is an iterator. (_Error_formatter::_M_print_word): Enhance behavior when displaying a word with an appended '\n'. * testsuite/util/debug/checks.h (check_insert4<>): New. * testsuite/23_containers/deque/debug/insert5_neg.cc: New. * testsuite/23_containers/vector/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/vector/debug/insert6_neg.cc: Likewise. * testsuite/23_containers/vector/debug/57779_neg.cc: Likewise. * testsuite/23_containers/list/debug/insert5_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/insert_after4_neg.cc: Likewise. From-SVN: r201416
2013-08-01 21:54:46 +02:00
_M_message(__gnu_debug::__msg_insert_range_from_self)\
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_sequence(*this, "this"))
/** Verify that we can erase the element referenced by the iterator
* _Position. We can erase the element if the _Position iterator is
* dereferenceable and references this sequence.
*/
#define __glibcxx_check_erase(_Position) \
_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_erase_bad) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_erase_different) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
/** Verify that we can erase the element after the iterator
* _Position. We can erase the element if the _Position iterator is
* before a dereferenceable one and references this sequence.
*/
#define __glibcxx_check_erase_after(_Position) \
_GLIBCXX_DEBUG_VERIFY(_Position._M_before_dereferenceable(), \
_M_message(__gnu_debug::__msg_erase_after_bad) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
_M_message(__gnu_debug::__msg_erase_different) \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
/** Verify that we can erase the elements in the iterator range
* [_First, _Last). We can erase the elements if [_First, _Last) is a
* valid iterator range within this sequence.
*/
#define __glibcxx_check_erase_range(_First,_Last) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_erase_different) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
[multiple changes] 2010-09-29 Paolo Carlini <paolo.carlini@oracle.com> * include/Makefile.am: Add debug/forward_list. * include/Makefile.in: Regenerate. * testsuite/util/testsuite_container_traits.h (traits_base): Add has_erase_after and hash_insert_after typedefs. (traits<forward_list<>>): Adjust. * testsuite/util/exception/safety.h (erase_point, erase_range, insert_point): Deal correctly with forward_list. * include/Makefile.am: Add. 2010-09-29 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Add forward_list specific debug messages. * include/debug/forward_list: New. * include/debug/formatter.h: Add debug message ids and before begin iterator state. * include/debug/macros.h (__glibcxx_check_insert_after, __glibcxx_check_insert_range_after, __glibcxx_check_erase_after, __glibcxx_check_erase_range_after): Add. * include/debug/safe_iterator.h (_BeforeBeginHelper): Add. (_Safe_iterator<>::_M_before_dereferenceable, _Safe_iterator<>::_M_is_before_begin): Add. (_Safe_iterator<>::_M_dereferenceable, _Safe_iterator<>::_M_is_end, _Safe_iterator<>::_M_incrementable): Adjust. * include/std/forward_list: Include debug/forward when _GLIBCXX_DEBUG defined. * include/bits/forward_list.h, forward_list.tcc: Put in std::__norm when debug mode is active. * testsuite/23_containers/forward_list/capacity/1.cc: Fix to compile even in debug mode. * testsuite/23_containers/forward_list/debug/erase_after1.cc, erase_after2.cc, erase_after3.cc, erase_after4.cc, erase_after5.cc, insert_after1.cc,erase_after6.cc, erase_after7.cc, insert_after2.cc, erase_after8.cc, insert_after3.cc, erase_after9.cc: New. From-SVN: r164717
2010-09-29 13:56:34 +02:00
/** Verify that we can erase the elements in the iterator range
* (_First, _Last). We can erase the elements if (_First, _Last) is a
* valid iterator range within this sequence.
*/
#define __glibcxx_check_erase_range_after(_First,_Last) \
_GLIBCXX_DEBUG_VERIFY(_First._M_can_compare(_Last), \
_M_message(__gnu_debug::__msg_erase_different) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
_M_message(__gnu_debug::__msg_erase_different) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First)); \
_GLIBCXX_DEBUG_VERIFY(_First != _Last, \
_M_message(__gnu_debug::__msg_valid_range2) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(_First._M_incrementable(), \
_M_message(__gnu_debug::__msg_valid_range2) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(!_Last._M_is_before_begin(), \
_M_message(__gnu_debug::__msg_valid_range2) \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)) \
// Verify that the subscript _N is less than the container's size.
#define __glibcxx_check_subscript(_N) \
_GLIBCXX_DEBUG_VERIFY(_N < this->size(), \
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
_M_message(__gnu_debug::__msg_subscript_oob) \
._M_sequence(*this, "this") \
._M_integer(_N, #_N) \
._M_integer(this->size(), "size"))
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
// Verify that the bucket _N is less than the container's buckets count.
#define __glibcxx_check_bucket_index(_N) \
_GLIBCXX_DEBUG_VERIFY(_N < this->bucket_count(), \
_M_message(__gnu_debug::__msg_bucket_index_oob) \
._M_sequence(*this, "this") \
._M_integer(_N, #_N) \
._M_integer(this->bucket_count(), "size"))
// Verify that the container is nonempty
#define __glibcxx_check_nonempty() \
_GLIBCXX_DEBUG_VERIFY(! this->empty(), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_empty) \
._M_sequence(*this, "this"))
stl_algo.h (merge): Fix documentation. 2019-09-28 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_algo.h (merge): Fix documentation. * include/debug/functions.h (__check_sorted_aux): Add C++20 constexpr. (__check_sorted): Likewise and remove nested irreflexive check. (__check_sorted_set_aux, __check_sorted_set): Add C++20 constexpr. (__check_partitioned_lower, __check_partitioned_upper): Likewise. (_Irreflexive_checker::_S_is_valid): Likewise. (__is_irreflexive, __is_irreflexive_pred): Likewise. * include/debug/helper_functions.h (__get_distance): Add constexpr. (__valid_range_aux): Add C++20 constexpr. (__valid_range(_Iter, _Iter, _Distance_traits<_Iter>::__type&)): Likewise and add std::is_constant_evaluated check. (__valid_range_aux(_Iter, _Iter, std::input_iterator_tag)): New. (__valid_range_aux(_Iter, _Iter, std::random_accss_iterator_tag)): New. (__valid_range_aux(_Integral, _Integral, std::__true_type)): New, use latter. (__valid_range(_Iter, _Iter)): Adapt to use latter, add constexpr and __builtin_is_contant_evaludated check.. (__can_advance, __base): Add constexpr. * include/debug/macros.h [_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED] (_GLIBCXX_DEBUG_VERIFY_COND_AT): New. (__glibcxx_check_sorted): Use __glibcxx_check_irreflexive. (__glibcxx_check_sorted_pred): Use __glibcxx_check_irreflexive_pred. * testsuite/25_algorithms/binary_search/constexpr.cc: Use irreflexive std::less. * testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise. * testsuite/25_algorithms/merge/constexpr.cc: Fix order in camm. Fix lambda to be irreflexive. From-SVN: r276260
2019-09-28 23:11:55 +02:00
// Verify that a predicate is irreflexive
#define __glibcxx_check_irreflexive(_First,_Last) \
_GLIBCXX_DEBUG_VERIFY(_First == _Last || !(*_First < *_First), \
_M_message(__gnu_debug::__msg_irreflexive_ordering) \
._M_iterator_value_type(_First, "< operator type"))
#if __cplusplus >= 201103L
# define __glibcxx_check_irreflexive2(_First,_Last) \
_GLIBCXX_DEBUG_VERIFY(_First == _Last \
|| __gnu_debug::__is_irreflexive(_First), \
_M_message(__gnu_debug::__msg_irreflexive_ordering) \
._M_iterator_value_type(_First, "< operator type"))
#else
# define __glibcxx_check_irreflexive2(_First,_Last)
#endif
#define __glibcxx_check_irreflexive_pred(_First,_Last,_Pred) \
_GLIBCXX_DEBUG_VERIFY(_First == _Last || !_Pred(*_First, *_First), \
_M_message(__gnu_debug::__msg_irreflexive_ordering) \
._M_instance(_Pred, "functor") \
._M_iterator_value_type(_First, "ordered type"))
#if __cplusplus >= 201103L
# define __glibcxx_check_irreflexive_pred2(_First,_Last,_Pred) \
_GLIBCXX_DEBUG_VERIFY(_First == _Last \
||__gnu_debug::__is_irreflexive_pred(_First, _Pred), \
_M_message(__gnu_debug::__msg_irreflexive_ordering) \
._M_instance(_Pred, "functor") \
._M_iterator_value_type(_First, "ordered type"))
#else
# define __glibcxx_check_irreflexive_pred2(_First,_Last,_Pred)
#endif
// Verify that the iterator range [_First, _Last) is sorted
#define __glibcxx_check_sorted(_First,_Last) \
__glibcxx_check_valid_range(_First,_Last); \
stl_algo.h (merge): Fix documentation. 2019-09-28 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_algo.h (merge): Fix documentation. * include/debug/functions.h (__check_sorted_aux): Add C++20 constexpr. (__check_sorted): Likewise and remove nested irreflexive check. (__check_sorted_set_aux, __check_sorted_set): Add C++20 constexpr. (__check_partitioned_lower, __check_partitioned_upper): Likewise. (_Irreflexive_checker::_S_is_valid): Likewise. (__is_irreflexive, __is_irreflexive_pred): Likewise. * include/debug/helper_functions.h (__get_distance): Add constexpr. (__valid_range_aux): Add C++20 constexpr. (__valid_range(_Iter, _Iter, _Distance_traits<_Iter>::__type&)): Likewise and add std::is_constant_evaluated check. (__valid_range_aux(_Iter, _Iter, std::input_iterator_tag)): New. (__valid_range_aux(_Iter, _Iter, std::random_accss_iterator_tag)): New. (__valid_range_aux(_Integral, _Integral, std::__true_type)): New, use latter. (__valid_range(_Iter, _Iter)): Adapt to use latter, add constexpr and __builtin_is_contant_evaludated check.. (__can_advance, __base): Add constexpr. * include/debug/macros.h [_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED] (_GLIBCXX_DEBUG_VERIFY_COND_AT): New. (__glibcxx_check_sorted): Use __glibcxx_check_irreflexive. (__glibcxx_check_sorted_pred): Use __glibcxx_check_irreflexive_pred. * testsuite/25_algorithms/binary_search/constexpr.cc: Use irreflexive std::less. * testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise. * testsuite/25_algorithms/merge/constexpr.cc: Fix order in camm. Fix lambda to be irreflexive. From-SVN: r276260
2019-09-28 23:11:55 +02:00
__glibcxx_check_irreflexive(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last)), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_unsorted) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
/** Verify that the iterator range [_First, _Last) is sorted by the
predicate _Pred. */
#define __glibcxx_check_sorted_pred(_First,_Last,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \
stl_algo.h (merge): Fix documentation. 2019-09-28 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_algo.h (merge): Fix documentation. * include/debug/functions.h (__check_sorted_aux): Add C++20 constexpr. (__check_sorted): Likewise and remove nested irreflexive check. (__check_sorted_set_aux, __check_sorted_set): Add C++20 constexpr. (__check_partitioned_lower, __check_partitioned_upper): Likewise. (_Irreflexive_checker::_S_is_valid): Likewise. (__is_irreflexive, __is_irreflexive_pred): Likewise. * include/debug/helper_functions.h (__get_distance): Add constexpr. (__valid_range_aux): Add C++20 constexpr. (__valid_range(_Iter, _Iter, _Distance_traits<_Iter>::__type&)): Likewise and add std::is_constant_evaluated check. (__valid_range_aux(_Iter, _Iter, std::input_iterator_tag)): New. (__valid_range_aux(_Iter, _Iter, std::random_accss_iterator_tag)): New. (__valid_range_aux(_Integral, _Integral, std::__true_type)): New, use latter. (__valid_range(_Iter, _Iter)): Adapt to use latter, add constexpr and __builtin_is_contant_evaludated check.. (__can_advance, __base): Add constexpr. * include/debug/macros.h [_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED] (_GLIBCXX_DEBUG_VERIFY_COND_AT): New. (__glibcxx_check_sorted): Use __glibcxx_check_irreflexive. (__glibcxx_check_sorted_pred): Use __glibcxx_check_irreflexive_pred. * testsuite/25_algorithms/binary_search/constexpr.cc: Use irreflexive std::less. * testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise. * testsuite/25_algorithms/merge/constexpr.cc: Fix order in camm. Fix lambda to be irreflexive. From-SVN: r276260
2019-09-28 23:11:55 +02:00
__glibcxx_check_irreflexive_pred(_First,_Last,_Pred); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Pred), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_unsorted_pred) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred))
// Special variant for std::merge, std::includes, std::set_*
#define __glibcxx_check_sorted_set(_First1,_Last1,_First2) \
__glibcxx_check_valid_range(_First1,_Last1); \
_GLIBCXX_DEBUG_VERIFY( \
__gnu_debug::__check_sorted_set(__gnu_debug::__base(_First1), \
__gnu_debug::__base(_Last1), _First2),\
_M_message(__gnu_debug::__msg_unsorted) \
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1))
// Likewise with a _Pred.
#define __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
__glibcxx_check_valid_range(_First1,_Last1); \
_GLIBCXX_DEBUG_VERIFY( \
__gnu_debug::__check_sorted_set(__gnu_debug::__base(_First1), \
__gnu_debug::__base(_Last1), \
_First2, _Pred), \
_M_message(__gnu_debug::__msg_unsorted_pred) \
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1) \
._M_string(#_Pred))
/** Verify that the iterator range [_First, _Last) is partitioned
w.r.t. the value _Value. */
#define __glibcxx_check_partitioned_lower(_First,_Last,_Value) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_unpartitioned) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Value))
#define __glibcxx_check_partitioned_upper(_First,_Last,_Value) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value), \
_M_message(__gnu_debug::__msg_unpartitioned) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Value))
/** Verify that the iterator range [_First, _Last) is partitioned
w.r.t. the value _Value and predicate _Pred. */
#define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value, _Pred), \
_M_message(__gnu_debug::__msg_unpartitioned_pred) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred) \
._M_string(#_Value))
/** Verify that the iterator range [_First, _Last) is partitioned
w.r.t. the value _Value and predicate _Pred. */
#define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper( \
__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value, _Pred), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_unpartitioned_pred) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred) \
._M_string(#_Value))
// Verify that the iterator range [_First, _Last) is a heap
#define __glibcxx_check_heap(_First,_Last) \
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last)), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_not_heap) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
/** Verify that the iterator range [_First, _Last) is a heap
w.r.t. the predicate _Pred. */
#define __glibcxx_check_heap_pred(_First,_Last,_Pred) \
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), \
_Pred), \
c++config: Simplify debug namespaces. 2006-02-21 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Simplify debug namespaces. * include/ext/hash_set: Specialize insert_iterator after norm, debug containers have been (optionally) declared. Use nested namespaces. * include/ext/hash_map: Same. * include/debug/hash_map.h (insert): Add specialization for value pointer types. * include/debug/hash_set.h (insert): Same. * include/debug/hash_multimap.h: Change __gnu_debug_def to __debug. * include/debug/set.h: Same. * include/debug/bitset: Same. * include/debug/multiset.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/list: Same. * include/debug/multimap.h. Same. * include/debug/macros.h: Use __gnu_debug. * include/debug/debug.h: Same. * include/debug/formatter.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/safe_iterator.h: Same. * include/debug/safe_iterator.tcc: Same. (_M_invalidate): Adjust compare order. * include/debug/string: Change std::__gnu_debug to __gnu_debug. * include/ext/hashtable.h: Formatting fixes. * include/bits/stl_map.h: Formatting fixes. * src/compatibility.cc: Adjust compatibility symbols for old debug mode model. * src/debug_list.cc: Tweak. * src/debug.cc: Adjust namespaces. * docs/html/debug_mode.html: Adjust namespace names. * testsuite/25_algorithms/heap/heap.cc: Restore _GLIBCXX_DEBUG macro guards, as count values differ when in debug mode. * testsuite/23_containers/vector/26412.cc: Move to... * testsuite/23_containers/vector/26412-1.cc: ... here. * testsuite/23_containers/vector/26412-2.cc: Add. * include/ext/pb_assoc/detail/standard_policies.hpp (PB_ASSOC_HASH_NAMESPACE): Remove, use __gnu_cxx::hash_map and std::equal_to. * configure.ac (libtool_VERSION): To 6:8:0. * configure: Regenerate. * config/abi/pre/gnu.ver: Revert to exporting __gnu_debug symbols. (GLIBCXX_3.4.8): New. * testsuite/testsuite_abi.cc: Add GLIBCXX_3.4.8 to known versions. From-SVN: r111356
2006-02-22 01:57:24 +01:00
_M_message(__gnu_debug::__msg_not_heap_pred) \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred))
// Verify that load factor is positive
#define __glibcxx_check_max_load_factor(_F) \
_GLIBCXX_DEBUG_VERIFY(_F > 0.0f, \
_M_message(__gnu_debug::__msg_valid_load_factor) \
formatter.h (enum _Debug_msg_id): Add __msg_self_move_assign. 2012-03-09 Paolo Carlini <paolo.carlini@oracle.com> * include/debug/formatter.h (enum _Debug_msg_id): Add __msg_self_move_assign. * include/debug/macros.h (__glibcxx_check_self_move_assign): Add. * src/c++11/debug.cc (_S_debug_messages): Update. * include/debug/safe_iterator.h (_Safe_iterator<>::operator= (_Safe_iterator&&)): Add check for self move assignment. * include/debug/set.h: Likewise. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/unordered_set: Likewise. * include/debug/vector: Likewise. * include/debug/map.h: Likewise. * include/debug/deque: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * testsuite/21_strings/debug/self_move_assign_neg.cc: New. * testsuite/21_strings/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_map/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_map/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multimap/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multimap/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/set/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/ self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/vector/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/vector/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/deque/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/deque/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/list/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/list/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/ self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/map/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/map/debug/iterator_self_move_assign_neg.cc: Likewise. From-SVN: r185134
2012-03-09 11:37:34 +01:00
._M_sequence(*this, "this"))
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
#define __glibcxx_check_equal_allocs(_This, _Other) \
_GLIBCXX_DEBUG_VERIFY(_This.get_allocator() == _Other.get_allocator(), \
_M_message(__gnu_debug::__msg_equal_allocs) \
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
._M_sequence(_This, "this"))
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
#define __glibcxx_check_string(_String) _GLIBCXX_DEBUG_PEDASSERT(_String != 0)
#define __glibcxx_check_string_len(_String,_Len) \
_GLIBCXX_DEBUG_PEDASSERT(_String != 0 || _Len == 0)
#endif