gcc/libstdc++-v3/testsuite/23_containers
Patrick Palka 37edf28c24 libstdc++: Remove overzealous static_asserts from std::span
For a span with statically empty extent, we currently model the
preconditions of front(), back(), and operator[] as if they are
mandates, by using a static_assert to verify that extent != 0.  This
causes us to reject valid programs that would instantiate these member
functions and at runtime never call them.

Since they are already followed by more general runtime asserts, this
patch just removes these static_asserts altogether,

libstdc++-v3/ChangeLog:

	* include/std/span (span::front): Remove static_assert.
	(span::back): Likewise.
	(span::operator[]): Likewise.
	* testsuite/23_containers/span/back_neg.cc: Rewrite to verify
	that we check the preconditions of back() only when it's called.
	* testsuite/23_containers/span/front_neg.cc: Likewise for
	front().
	* testsuite/23_containers/span/index_op_neg.cc: Likewise for
	operator[].
2020-09-21 23:21:34 -04:00
..
array libstdc++: Fix three-way comparison for std::array [PR 96851] 2020-09-02 15:32:11 +01:00
bitset libstdc++: Fix ambiguous comparisons in __gnu_debug::bitset [PR 96303] 2020-08-07 20:29:11 +01:00
deque libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
forward_list libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
headers libstdc++: Require c++98_only effective target for some tests 2020-07-02 21:27:12 +01:00
list libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
map libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
multimap libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
multiset libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
priority_queue Library-side tests for parenthesized aggregate init 2020-03-31 17:07:52 +03:00
queue libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
set libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
span libstdc++: Remove overzealous static_asserts from std::span 2020-09-21 23:21:34 -04:00
stack libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
unordered_map libstdc++: Fix regression in hash containers 2020-08-26 17:44:23 +01:00
unordered_multimap libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
unordered_multiset libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
unordered_set libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00
vector libstdc++: Remove tests for self-move debug assertions 2020-08-25 16:36:01 +01:00