aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorFrançois Dumont <fdumont@gcc.gnu.org>2015-08-24 20:21:57 +0000
committerFrançois Dumont <fdumont@gcc.gnu.org>2015-08-24 20:21:57 +0000
commit41e4e5edce30e6340a8e42e26a19adb2418055c5 (patch)
tree89b7c956187aa4685806c80203e0548bf6a7c7aa /libstdc++-v3/src
parent1b533361dae91d9a13679b8377111b91cf554217 (diff)
downloadgcc-41e4e5edce30e6340a8e42e26a19adb2418055c5.zip
gcc-41e4e5edce30e6340a8e42e26a19adb2418055c5.tar.gz
gcc-41e4e5edce30e6340a8e42e26a19adb2418055c5.tar.bz2
formatter.h (_Debug_msg_id::__msg_irreflexive_ordering): New enum entry.
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. From-SVN: r227147
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/c++11/debug.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libstdc++-v3/src/c++11/debug.cc b/libstdc++-v3/src/c++11/debug.cc
index f60e31f..997c0f3 100644
--- a/libstdc++-v3/src/c++11/debug.cc
+++ b/libstdc++-v3/src/c++11/debug.cc
@@ -185,7 +185,8 @@ namespace __gnu_debug
"load factor shall be positive",
"allocators must be equal",
"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
@@ -592,11 +593,13 @@ namespace
{
const int __bufsize = 64;
char __buf[__bufsize];
- __formatter->_M_format_word(__buf, __bufsize, "\"%s\" ",
+ __formatter->_M_format_word(__buf, __bufsize, "\"%s\"",
__variant._M_name);
__formatter->_M_print_word(__buf);
}
+ __formatter->_M_print_word(" {\n");
+
if (__variant._M_type)
{
__formatter->_M_print_word(" type = ");
@@ -768,6 +771,7 @@ namespace __gnu_debug
_M_variant._M_iterator._M_sequence);
__formatter->_M_print_word(__buf);
}
+
__formatter->_M_print_word("}\n");
break;
case __sequence:
@@ -786,10 +790,12 @@ namespace __gnu_debug
if (_M_variant._M_instance._M_type)
__formatter->_M_print_word(";\n");
+ __formatter->_M_print_word("}\n");
break;
case __iterator_value_type:
__formatter->_M_print_word("iterator::value_type ");
print_description(__formatter, _M_variant._M_iterator_value_type);
+ __formatter->_M_print_word("}\n");
break;
default:
break;