libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible
authorFrançois Dumont <fdumont@gcc.gnu.org>
Tue, 21 Jan 2020 18:12:29 +0000 (19:12 +0100)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 9 Nov 2020 20:11:13 +0000 (21:11 +0100)
commit38b17c27ce5a8e0cc5baa14697d4b5542b91b9d1
treeafdcc1232f79842a2546b0f785b551e7239e0926
parent3a5f8d745f8e26d973218b088788f22ad197ca67
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.
23 files changed:
libstdc++-v3/include/debug/assertions.h
libstdc++-v3/include/debug/formatter.h
libstdc++-v3/include/debug/helper_functions.h
libstdc++-v3/include/debug/macros.h
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_back_constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc [new file with mode: 0644]