Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
25c65938
Commit
25c65938
authored
Aug 25, 2015
by
François Dumont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert my change to commit with PR reference again.
From-SVN: r227187
parent
2f40eaca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
23 additions
and
348 deletions
+23
-348
libstdc++-v3/ChangeLog
+0
-55
libstdc++-v3/include/bits/stl_algo.h
+0
-0
libstdc++-v3/include/bits/stl_algobase.h
+0
-5
libstdc++-v3/include/bits/stl_heap.h
+0
-10
libstdc++-v3/include/debug/debug.h
+20
-32
libstdc++-v3/include/debug/formatter.h
+1
-2
libstdc++-v3/include/debug/functions.h
+0
-43
libstdc++-v3/include/debug/macros.h
+0
-33
libstdc++-v3/src/c++11/debug.cc
+2
-8
libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/debug/irreflexive_neg.cc
+0
-70
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc
+0
-47
libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
+0
-43
No files found.
libstdc++-v3/ChangeLog
View file @
25c65938
2015-08-24 François Dumont <fdumont@gcc.gnu.org>
* include/debug/formatter.h (_Debug_msg_id::__msg_irreflexive_ordering):
New enum entry.
* include/debug/functions.h (_Irreflexive_checker): New.
(__is_irreflexive, __is_irreflexive_pred): New.
* include/debug/macros.h
(__glibcxx_check_irreflexive, __glibcxx_check_irreflexive_pred): New
macros.
(__glibcxx_check_irreflexive2, __glibcxx_check_irreflexive_pred2): New
macros limited to post-C++11 mode.
* include/debug/debug.h
(__glibcxx_requires_irreflexive, __glibcxx_requires_irreflexive_pred):
New macros, use latter.
(__glibcxx_requires_irreflexive2, __glibcxx_requires_irreflexive_pred2):
Likewise.
* include/bits/stl_algo.h
(partial_sort_copy): Add irreflexive debug check.
(partial_sort_copy): Likewise.
(lower_bound): Likewise.
(upper_bound): Likewise.
(equal_range): Likewise.
(binary_search): Likewise.
(inplace_merge): Likewise.
(includes): Likewise.
(next_permutation): Likewise.
(prev_permutation): Likewise.
(is_sorted_until): Likewise.
(minmax_element): Likewise.
(partial_sort): Likewise.
(nth_element): Likewise.
(sort): Likewise.
(merge): Likewise.
(stable_sort): Likewise.
(set_union): Likewise.
(set_intersection): Likewise.
(set_difference): Likewise.
(set_symmetric_difference): Likewise.
(min_element): Likewise.
(max_element): Likewise.
* include/bits/stl_algobase.h
(lower_bound): Likewise.
(lexicographical_compare): Likewise.
* include/bits/stl_heap.h
(push_heap): Likewise.
(pop_heap): Likewise.
(make_heap): Likewise.
(sort_heap): Likewise.
(is_heap_until): Likewise.
* testsuite/25_algorithms/lexicographical_compare/debug/
irreflexive_neg.cc: New.
* testsuite/25_algorithms/lower_bound/debug/irreflexive.cc: New.
* testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc:
New.
2015-08-24 Jonathan Wakely <jwakely@redhat.com>
2015-08-24 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/65049
PR libstdc++/65049
...
...
libstdc++-v3/include/bits/stl_algo.h
View file @
25c65938
This diff is collapsed.
Click to expand it.
libstdc++-v3/include/bits/stl_algobase.h
View file @
25c65938
...
@@ -985,7 +985,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -985,7 +985,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_LessThanOpConcept
<
__glibcxx_function_requires
(
_LessThanOpConcept
<
typename
iterator_traits
<
_ForwardIterator
>::
value_type
,
_Tp
>
)
typename
iterator_traits
<
_ForwardIterator
>::
value_type
,
_Tp
>
)
__glibcxx_requires_partitioned_lower
(
__first
,
__last
,
__val
);
__glibcxx_requires_partitioned_lower
(
__first
,
__last
,
__val
);
__glibcxx_requires_irreflexive2
(
__first
,
__last
);
return
std
::
__lower_bound
(
__first
,
__last
,
__val
,
return
std
::
__lower_bound
(
__first
,
__last
,
__val
,
__gnu_cxx
::
__ops
::
__iter_less_val
());
__gnu_cxx
::
__ops
::
__iter_less_val
());
...
@@ -1210,9 +1209,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
...
@@ -1210,9 +1209,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
__glibcxx_function_requires
(
_LessThanOpConcept
<
_ValueType1
,
_ValueType2
>
)
__glibcxx_function_requires
(
_LessThanOpConcept
<
_ValueType1
,
_ValueType2
>
)
__glibcxx_function_requires
(
_LessThanOpConcept
<
_ValueType2
,
_ValueType1
>
)
__glibcxx_function_requires
(
_LessThanOpConcept
<
_ValueType2
,
_ValueType1
>
)
__glibcxx_requires_valid_range
(
__first1
,
__last1
);
__glibcxx_requires_valid_range
(
__first1
,
__last1
);
__glibcxx_requires_irreflexive2
(
__first1
,
__last1
);
__glibcxx_requires_valid_range
(
__first2
,
__last2
);
__glibcxx_requires_valid_range
(
__first2
,
__last2
);
__glibcxx_requires_irreflexive2
(
__first2
,
__last2
);
return
std
::
__lexicographical_compare_aux
(
std
::
__niter_base
(
__first1
),
return
std
::
__lexicographical_compare_aux
(
std
::
__niter_base
(
__first1
),
std
::
__niter_base
(
__last1
),
std
::
__niter_base
(
__last1
),
...
@@ -1242,9 +1239,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
...
@@ -1242,9 +1239,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
__glibcxx_function_requires
(
_InputIteratorConcept
<
_II1
>
)
__glibcxx_function_requires
(
_InputIteratorConcept
<
_II1
>
)
__glibcxx_function_requires
(
_InputIteratorConcept
<
_II2
>
)
__glibcxx_function_requires
(
_InputIteratorConcept
<
_II2
>
)
__glibcxx_requires_valid_range
(
__first1
,
__last1
);
__glibcxx_requires_valid_range
(
__first1
,
__last1
);
__glibcxx_requires_irreflexive_pred2
(
__first1
,
__last1
,
__comp
);
__glibcxx_requires_valid_range
(
__first2
,
__last2
);
__glibcxx_requires_valid_range
(
__first2
,
__last2
);
__glibcxx_requires_irreflexive_pred2
(
__first2
,
__last2
,
__comp
);
return
std
::
__lexicographical_compare_impl
return
std
::
__lexicographical_compare_impl
(
__first1
,
__last1
,
__first2
,
__last2
,
(
__first1
,
__last1
,
__first2
,
__last2
,
...
...
libstdc++-v3/include/bits/stl_heap.h
View file @
25c65938
...
@@ -159,7 +159,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -159,7 +159,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_function_requires
(
_LessThanComparableConcept
<
_ValueType
>
)
__glibcxx_function_requires
(
_LessThanComparableConcept
<
_ValueType
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive
(
__first
,
__last
);
__glibcxx_requires_heap
(
__first
,
__last
-
1
);
__glibcxx_requires_heap
(
__first
,
__last
-
1
);
_ValueType
__value
=
_GLIBCXX_MOVE
(
*
(
__last
-
1
));
_ValueType
__value
=
_GLIBCXX_MOVE
(
*
(
__last
-
1
));
...
@@ -194,7 +193,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -194,7 +193,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive_pred
(
__first
,
__last
,
__comp
);
__glibcxx_requires_heap_pred
(
__first
,
__last
-
1
,
__comp
);
__glibcxx_requires_heap_pred
(
__first
,
__last
-
1
,
__comp
);
_ValueType
__value
=
_GLIBCXX_MOVE
(
*
(
__last
-
1
));
_ValueType
__value
=
_GLIBCXX_MOVE
(
*
(
__last
-
1
));
...
@@ -273,7 +271,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -273,7 +271,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_LessThanComparableConcept
<
_ValueType
>
)
__glibcxx_function_requires
(
_LessThanComparableConcept
<
_ValueType
>
)
__glibcxx_requires_non_empty_range
(
__first
,
__last
);
__glibcxx_requires_non_empty_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive
(
__first
,
__last
);
__glibcxx_requires_heap
(
__first
,
__last
);
__glibcxx_requires_heap
(
__first
,
__last
);
if
(
__last
-
__first
>
1
)
if
(
__last
-
__first
>
1
)
...
@@ -304,7 +301,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -304,7 +301,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive_pred
(
__first
,
__last
,
__comp
);
__glibcxx_requires_non_empty_range
(
__first
,
__last
);
__glibcxx_requires_non_empty_range
(
__first
,
__last
);
__glibcxx_requires_heap_pred
(
__first
,
__last
,
__comp
);
__glibcxx_requires_heap_pred
(
__first
,
__last
,
__comp
);
...
@@ -360,7 +356,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -360,7 +356,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_LessThanComparableConcept
<
__glibcxx_function_requires
(
_LessThanComparableConcept
<
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive
(
__first
,
__last
);
std
::
__make_heap
(
__first
,
__last
,
std
::
__make_heap
(
__first
,
__last
,
__gnu_cxx
::
__ops
::
__iter_less_iter
());
__gnu_cxx
::
__ops
::
__iter_less_iter
());
...
@@ -385,7 +380,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -385,7 +380,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive_pred
(
__first
,
__last
,
__comp
);
std
::
__make_heap
(
__first
,
__last
,
std
::
__make_heap
(
__first
,
__last
,
__gnu_cxx
::
__ops
::
__iter_comp_iter
(
__comp
));
__gnu_cxx
::
__ops
::
__iter_comp_iter
(
__comp
));
...
@@ -421,7 +415,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -421,7 +415,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_LessThanComparableConcept
<
__glibcxx_function_requires
(
_LessThanComparableConcept
<
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive
(
__first
,
__last
);
__glibcxx_requires_heap
(
__first
,
__last
);
__glibcxx_requires_heap
(
__first
,
__last
);
std
::
__sort_heap
(
__first
,
__last
,
std
::
__sort_heap
(
__first
,
__last
,
...
@@ -447,7 +440,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -447,7 +440,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
__glibcxx_function_requires
(
_Mutable_RandomAccessIteratorConcept
<
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive_pred
(
__first
,
__last
,
__comp
);
__glibcxx_requires_heap_pred
(
__first
,
__last
,
__comp
);
__glibcxx_requires_heap_pred
(
__first
,
__last
,
__comp
);
std
::
__sort_heap
(
__first
,
__last
,
std
::
__sort_heap
(
__first
,
__last
,
...
@@ -475,7 +467,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -475,7 +467,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_LessThanComparableConcept
<
__glibcxx_function_requires
(
_LessThanComparableConcept
<
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
typename
iterator_traits
<
_RandomAccessIterator
>::
value_type
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive
(
__first
,
__last
);
return
__first
+
return
__first
+
std
::
__is_heap_until
(
__first
,
std
::
distance
(
__first
,
__last
),
std
::
__is_heap_until
(
__first
,
std
::
distance
(
__first
,
__last
),
...
@@ -502,7 +493,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
...
@@ -502,7 +493,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__glibcxx_function_requires
(
_RandomAccessIteratorConcept
<
__glibcxx_function_requires
(
_RandomAccessIteratorConcept
<
_RandomAccessIterator
>
)
_RandomAccessIterator
>
)
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_valid_range
(
__first
,
__last
);
__glibcxx_requires_irreflexive_pred
(
__first
,
__last
,
__comp
);
return
__first
return
__first
+
std
::
__is_heap_until
(
__first
,
std
::
distance
(
__first
,
__last
),
+
std
::
__is_heap_until
(
__first
,
std
::
distance
(
__first
,
__last
),
...
...
libstdc++-v3/include/debug/debug.h
View file @
25c65938
...
@@ -77,53 +77,41 @@ namespace __gnu_debug
...
@@ -77,53 +77,41 @@ namespace __gnu_debug
# define __glibcxx_requires_string(_String)
# define __glibcxx_requires_string(_String)
# define __glibcxx_requires_string_len(_String,_Len)
# define __glibcxx_requires_string_len(_String,_Len)
# define __glibcxx_requires_subscript(_N)
# define __glibcxx_requires_subscript(_N)
# define __glibcxx_requires_irreflexive(_First,_Last)
# define __glibcxx_requires_irreflexive2(_First,_Last)
# define __glibcxx_requires_irreflexive_pred(_First,_Last,_Pred)
# define __glibcxx_requires_irreflexive_pred2(_First,_Last,_Pred)
#else
#else
# include <debug/macros.h>
# include <debug/macros.h>
# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
# define __glibcxx_requires_valid_range(_First,_Last)
\
# define __glibcxx_requires_valid_range(_First,_Last)
\
__glibcxx_check_valid_range(_First,_Last)
__glibcxx_check_valid_range(_First,_Last)
# define __glibcxx_requires_non_empty_range(_First,_Last)
\
# define __glibcxx_requires_non_empty_range(_First,_Last)
\
__glibcxx_check_non_empty_range(_First,_Last)
__glibcxx_check_non_empty_range(_First,_Last)
# define __glibcxx_requires_sorted(_First,_Last)
\
# define __glibcxx_requires_sorted(_First,_Last)
\
__glibcxx_check_sorted(_First,_Last)
__glibcxx_check_sorted(_First,_Last)
# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
\
# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
\
__glibcxx_check_sorted_pred(_First,_Last,_Pred)
__glibcxx_check_sorted_pred(_First,_Last,_Pred)
# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2)
\
# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2)
\
__glibcxx_check_sorted_set(_First1,_Last1,_First2)
__glibcxx_check_sorted_set(_First1,_Last1,_First2)
# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
__glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred)
__glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred)
# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \
# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \
__glibcxx_check_partitioned_lower(_First,_Last,_Value)
__glibcxx_check_partitioned_lower(_First,_Last,_Value)
# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \
# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \
__glibcxx_check_partitioned_upper(_First,_Last,_Value)
__glibcxx_check_partitioned_upper(_First,_Last,_Value)
# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred)
__glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred)
# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred)
__glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred)
# define __glibcxx_requires_heap(_First,_Last)
\
# define __glibcxx_requires_heap(_First,_Last)
\
__glibcxx_check_heap(_First,_Last)
__glibcxx_check_heap(_First,_Last)
# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
\
# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
\
__glibcxx_check_heap_pred(_First,_Last,_Pred)
__glibcxx_check_heap_pred(_First,_Last,_Pred)
# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
# define __glibcxx_requires_string_len(_String,_Len) \
# define __glibcxx_requires_string_len(_String,_Len) \
__glibcxx_check_string_len(_String,_Len)
__glibcxx_check_string_len(_String,_Len)
# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
# define __glibcxx_requires_irreflexive(_First,_Last) \
__glibcxx_check_irreflexive(_First,_Last)
# define __glibcxx_requires_irreflexive2(_First,_Last) \
__glibcxx_check_irreflexive2(_First,_Last)
# define __glibcxx_requires_irreflexive_pred(_First,_Last,_Pred) \
__glibcxx_check_irreflexive_pred(_First,_Last,_Pred)
# define __glibcxx_requires_irreflexive_pred2(_First,_Last,_Pred) \
__glibcxx_check_irreflexive_pred2(_First,_Last,_Pred)
# include <debug/functions.h>
# include <debug/functions.h>
...
...
libstdc++-v3/include/debug/formatter.h
View file @
25c65938
...
@@ -126,8 +126,7 @@ namespace __gnu_debug
...
@@ -126,8 +126,7 @@ namespace __gnu_debug
__msg_valid_load_factor
,
__msg_valid_load_factor
,
// others
// others
__msg_equal_allocs
,
__msg_equal_allocs
,
__msg_insert_range_from_self
,
__msg_insert_range_from_self
__msg_irreflexive_ordering
};
};
class
_Error_formatter
class
_Error_formatter
...
...
libstdc++-v3/include/debug/functions.h
View file @
25c65938
...
@@ -445,49 +445,6 @@ namespace __gnu_debug
...
@@ -445,49 +445,6 @@ namespace __gnu_debug
return
__first
==
__last
;
return
__first
==
__last
;
}
}
#if __cplusplus >= 201103L
struct
_Irreflexive_checker
{
template
<
typename
_It
>
static
typename
std
::
iterator_traits
<
_It
>::
reference
__deref
();
template
<
typename
_It
,
typename
=
decltype
(
__deref
<
_It
>
()
<
__deref
<
_It
>
())
>
static
bool
_S_is_valid
(
_It
__it
)
{
return
!
(
*
__it
<
*
__it
);
}
// Fallback method if operator doesn't exist.
template
<
typename
...
_Args
>
static
bool
_S_is_valid
(
_Args
...)
{
return
true
;
}
template
<
typename
_It
,
typename
_Pred
,
typename
=
decltype
(
std
::
declval
<
_Pred
>
()(
__deref
<
_It
>
(),
__deref
<
_It
>
()))
>
static
bool
_S_is_valid_pred
(
_It
__it
,
_Pred
__pred
)
{
return
!
__pred
(
*
__it
,
*
__it
);
}
// Fallback method if predicate can't be invoked.
template
<
typename
...
_Args
>
static
bool
_S_is_valid_pred
(
_Args
...)
{
return
true
;
}
};
template
<
typename
_Iterator
>
inline
bool
__is_irreflexive
(
_Iterator
__it
)
{
return
_Irreflexive_checker
::
_S_is_valid
(
__it
);
}
template
<
typename
_Iterator
,
typename
_Pred
>
inline
bool
__is_irreflexive_pred
(
_Iterator
__it
,
_Pred
__pred
)
{
return
_Irreflexive_checker
::
_S_is_valid_pred
(
__it
,
__pred
);
}
#endif
}
// namespace __gnu_debug
}
// namespace __gnu_debug
#endif
#endif
libstdc++-v3/include/debug/macros.h
View file @
25c65938
...
@@ -362,37 +362,4 @@ _GLIBCXX_DEBUG_VERIFY(_This.get_allocator() == _Other.get_allocator(), \
...
@@ -362,37 +362,4 @@ _GLIBCXX_DEBUG_VERIFY(_This.get_allocator() == _Other.get_allocator(), \
#define __glibcxx_check_string_len(_String,_Len) \
#define __glibcxx_check_string_len(_String,_Len) \
_GLIBCXX_DEBUG_PEDASSERT(_String != 0 || _Len == 0)
_GLIBCXX_DEBUG_PEDASSERT(_String != 0 || _Len == 0)
// 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
#endif
#endif
libstdc++-v3/src/c++11/debug.cc
View file @
25c65938
...
@@ -185,8 +185,7 @@ namespace __gnu_debug
...
@@ -185,8 +185,7 @@ namespace __gnu_debug
"load factor shall be positive"
,
"load factor shall be positive"
,
"allocators must be equal"
,
"allocators must be equal"
,
"attempt to insert with an iterator range [%1.name;, %2.name;) from this"
"attempt to insert with an iterator range [%1.name;, %2.name;) from this"
" container"
,
" container"
"comparison doesn't meet irreflexive requirements, assert(!(a < a))"
};
};
void
void
...
@@ -593,13 +592,11 @@ namespace
...
@@ -593,13 +592,11 @@ namespace
{
{
const
int
__bufsize
=
64
;
const
int
__bufsize
=
64
;
char
__buf
[
__bufsize
];
char
__buf
[
__bufsize
];
__formatter
->
_M_format_word
(
__buf
,
__bufsize
,
"
\"
%s
\"
"
,
__formatter
->
_M_format_word
(
__buf
,
__bufsize
,
"
\"
%s
\"
"
,
__variant
.
_M_name
);
__variant
.
_M_name
);
__formatter
->
_M_print_word
(
__buf
);
__formatter
->
_M_print_word
(
__buf
);
}
}
__formatter
->
_M_print_word
(
" {
\n
"
);
if
(
__variant
.
_M_type
)
if
(
__variant
.
_M_type
)
{
{
__formatter
->
_M_print_word
(
" type = "
);
__formatter
->
_M_print_word
(
" type = "
);
...
@@ -771,7 +768,6 @@ namespace __gnu_debug
...
@@ -771,7 +768,6 @@ namespace __gnu_debug
_M_variant
.
_M_iterator
.
_M_sequence
);
_M_variant
.
_M_iterator
.
_M_sequence
);
__formatter
->
_M_print_word
(
__buf
);
__formatter
->
_M_print_word
(
__buf
);
}
}
__formatter
->
_M_print_word
(
"}
\n
"
);
__formatter
->
_M_print_word
(
"}
\n
"
);
break
;
break
;
case
__sequence
:
case
__sequence
:
...
@@ -790,12 +786,10 @@ namespace __gnu_debug
...
@@ -790,12 +786,10 @@ namespace __gnu_debug
if
(
_M_variant
.
_M_instance
.
_M_type
)
if
(
_M_variant
.
_M_instance
.
_M_type
)
__formatter
->
_M_print_word
(
";
\n
"
);
__formatter
->
_M_print_word
(
";
\n
"
);
__formatter
->
_M_print_word
(
"}
\n
"
);
break
;
break
;
case
__iterator_value_type
:
case
__iterator_value_type
:
__formatter
->
_M_print_word
(
"iterator::value_type "
);
__formatter
->
_M_print_word
(
"iterator::value_type "
);
print_description
(
__formatter
,
_M_variant
.
_M_iterator_value_type
);
print_description
(
__formatter
,
_M_variant
.
_M_iterator_value_type
);
__formatter
->
_M_print_word
(
"}
\n
"
);
break
;
break
;
default
:
default
:
break
;
break
;
...
...
libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/debug/irreflexive_neg.cc
deleted
100644 → 0
View file @
2f40eaca
// Copyright (C) 2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
//
// { dg-options "-std=gnu++11" }
// { dg-require-debug-mode "" }
// { dg-do run { xfail *-*-* } }
#include <algorithm>
#include <testsuite_hooks.h>
struct
A
{
A
(
int
i
)
:
_i
(
i
)
{
}
int
_i
;
};
bool
operator
<
(
A
a
,
int
i
)
{
return
a
.
_i
<
i
;
}
bool
operator
<
(
int
i
,
A
a
)
{
return
i
<
a
.
_i
;
}
void
test01
()
{
bool
test
__attribute__
((
unused
))
=
true
;
A
as
[]
{
0
,
1
,
2
,
3
};
int
is
[]
{
0
,
1
,
2
,
3
};
VERIFY
(
!
std
::
lexicographical_compare
(
as
,
as
+
4
,
is
,
is
+
4
)
);
}
bool
bad_lower
(
int
lhs
,
int
rhs
)
{
if
(
lhs
==
0
)
return
true
;
return
lhs
<
rhs
;
}
void
test02
()
{
int
is
[]
{
0
,
1
,
2
,
3
};
std
::
lexicographical_compare
(
is
,
is
+
4
,
is
,
is
+
4
,
bad_lower
);
}
int
main
()
{
test01
();
test02
();
return
0
;
}
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc
deleted
100644 → 0
View file @
2f40eaca
// Copyright (C) 2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
//
// { dg-require-debug-mode "" }
// { dg-do compile }
#include <algorithm>
struct
A
{
A
(
int
i
)
:
_i
(
i
)
{
}
int
_i
;
};
// Only knowns how to compare an A with an int.
struct
A_int_comparer
{
bool
operator
()(
A
a
,
int
i
)
const
{
return
a
.
_i
<
i
;
}
bool
operator
()(
int
i
,
A
a
)
const
{
return
i
<
a
.
_i
;
}
};
void
test01
()
{
A
as
[]
{
0
,
1
,
2
,
3
};
std
::
lower_bound
(
as
,
as
+
4
,
1
,
A_int_comparer
());
}
libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
deleted
100644 → 0
View file @
2f40eaca
// Copyright (C) 2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
//
// { dg-require-debug-mode "" }
// { dg-do run { xfail *-*-* } }
#include <algorithm>
bool
bad_lower
(
int
lhs
,
int
rhs
)
{
if
(
lhs
==
0
)
return
true
;
return
lhs
<
rhs
;
}
void
test01
()
{
int
ins
[]
{
0
,
1
,
2
,
3
};
int
outs
[]
{
9
,
9
};
std
::
partial_sort_copy
(
ins
,
ins
+
4
,
outs
,
outs
+
2
,
bad_lower
);
}
int
main
()
{
test01
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment