aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
committerIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
commitaa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch)
tree886212591b1c9d127eaaf234a4a2e22452ea384a /libstdc++-v3/include/debug
parent97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff)
parent3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff)
downloadgcc-devel/gccgo.zip
gcc-devel/gccgo.tar.gz
gcc-devel/gccgo.tar.bz2
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r--libstdc++-v3/include/debug/helper_functions.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/libstdc++-v3/include/debug/helper_functions.h b/libstdc++-v3/include/debug/helper_functions.h
index dccf8e9..052b36b 100644
--- a/libstdc++-v3/include/debug/helper_functions.h
+++ b/libstdc++-v3/include/debug/helper_functions.h
@@ -111,12 +111,19 @@ namespace __gnu_debug
_GLIBCXX_CONSTEXPR
inline typename _Distance_traits<_Iterator>::__type
__get_distance(_Iterator __lhs, _Iterator __rhs)
- { return __get_distance(__lhs, __rhs, std::__iterator_category(__lhs)); }
+ {
+ return __gnu_debug::__get_distance(__lhs, __rhs,
+ std::__iterator_category(__lhs));
+ }
// An arbitrary iterator pointer is not singular.
inline bool
__check_singular_aux(const void*) { return false; }
+ // Defined in <debug/safe_base.h>
+ bool
+ __check_singular_aux(const class _Safe_iterator_base*);
+
// We may have an iterator that derives from _Safe_iterator_base but isn't
// a _Safe_iterator.
template<typename _Iterator>
@@ -125,7 +132,7 @@ namespace __gnu_debug
__check_singular(_Iterator const& __x)
{
return ! std::__is_constant_evaluated()
- && __check_singular_aux(std::__addressof(__x));
+ && __gnu_debug::__check_singular_aux(std::__addressof(__x));
}
/** Non-NULL pointers are nonsingular. */
@@ -163,7 +170,8 @@ namespace __gnu_debug
std::input_iterator_tag)
{
return __first == __last
- || (!__check_singular(__first) && !__check_singular(__last));
+ || (!__gnu_debug::__check_singular(__first)
+ && !__gnu_debug::__check_singular(__last));
}
template<typename _InputIterator>
@@ -172,8 +180,8 @@ namespace __gnu_debug
__valid_range_aux(_InputIterator __first, _InputIterator __last,
std::random_access_iterator_tag)
{
- return
- __valid_range_aux(__first, __last, std::input_iterator_tag())
+ return __gnu_debug::__valid_range_aux(__first, __last,
+ std::input_iterator_tag())
&& __first <= __last;
}
@@ -186,8 +194,8 @@ namespace __gnu_debug
__valid_range_aux(_InputIterator __first, _InputIterator __last,
std::__false_type)
{
- return __valid_range_aux(__first, __last,
- std::__iterator_category(__first));
+ return __gnu_debug::__valid_range_aux(__first, __last,
+ std::__iterator_category(__first));
}
template<typename _InputIterator>
@@ -197,10 +205,11 @@ namespace __gnu_debug
typename _Distance_traits<_InputIterator>::__type& __dist,
std::__false_type)
{
- if (!__valid_range_aux(__first, __last, std::input_iterator_tag()))
+ if (!__gnu_debug::__valid_range_aux(__first, __last,
+ std::input_iterator_tag()))
return false;
- __dist = __get_distance(__first, __last);
+ __dist = __gnu_debug::__get_distance(__first, __last);
switch (__dist.second)
{
case __dp_none:
@@ -231,7 +240,8 @@ namespace __gnu_debug
typename _Distance_traits<_InputIterator>::__type& __dist)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
- return __valid_range_aux(__first, __last, __dist, _Integral());
+ return __gnu_debug::__valid_range_aux(__first, __last, __dist,
+ _Integral());
}
template<typename _Iterator, typename _Sequence, typename _Category>
@@ -254,7 +264,7 @@ namespace __gnu_debug
__valid_range(_InputIterator __first, _InputIterator __last)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
- return __valid_range_aux(__first, __last, _Integral());
+ return __gnu_debug::__valid_range_aux(__first, __last, _Integral());
}
template<typename _Iterator, typename _Sequence, typename _Category>