gcc/libstdc++-v3/include/debug
Jonathan Wakely 031cb46341
libstdc++: Disable __gnu_debug::__is_singular(T*) in constexpr [PR109517]
Because of PR c++/85944 we have several bugs where _GLIBCXX_DEBUG causes
errors for constexpr code. Although Bug 117966 could be fixed by
avoiding redundant debug checks in std::span, and Bug 106212 could be
fixed by avoiding redundant debug checks in std::array, there are many
more cases where similar __glibcxx_requires_valid_range checks fail to
compile and removing the checks everywhere isn't desirable.

This just disables the __gnu_debug::__check_singular(T*) check during
constant evaluation. Attempting to dereference a null pointer will
certainly fail during constant evaluation (if it doesn't fail then it's
a compiler bug and not the library's problem). Disabling this check
during constant evaluation shouldn't do any harm.

libstdc++-v3/ChangeLog:

	PR libstdc++/109517
	PR libstdc++/109976
	* include/debug/helper_functions.h (__valid_range_aux): Treat
	all input iterator ranges as valid during constant evaluation.

(cherry picked from commit 9616deb23a)
2025-03-31 12:05:17 +01:00
..
array Update copyright years. 2023-01-16 11:52:17 +01:00
assertions.h Update copyright years. 2023-01-16 11:52:17 +01:00
bitset Update copyright years. 2023-01-16 11:52:17 +01:00
debug.h Update copyright years. 2023-01-16 11:52:17 +01:00
deque Update copyright years. 2023-01-16 11:52:17 +01:00
formatter.h Update copyright years. 2023-01-16 11:52:17 +01:00
forward_list Update copyright years. 2023-01-16 11:52:17 +01:00
functions.h Update copyright years. 2023-01-16 11:52:17 +01:00
helper_functions.h libstdc++: Disable __gnu_debug::__is_singular(T*) in constexpr [PR109517] 2025-03-31 12:05:17 +01:00
list Update copyright years. 2023-01-16 11:52:17 +01:00
macros.h Update copyright years. 2023-01-16 11:52:17 +01:00
map Update copyright years. 2023-01-16 11:52:17 +01:00
map.h libstdc++: Do not define _Insert_base::try_emplace before C++17 2024-12-07 10:08:51 +00:00
multimap.h Update copyright years. 2023-01-16 11:52:17 +01:00
multiset.h Update copyright years. 2023-01-16 11:52:17 +01:00
safe_base.h libstdc++: Make debug sequence members mutable [PR116369] 2024-10-16 20:58:48 +01:00
safe_container.h Update copyright years. 2023-01-16 11:52:17 +01:00
safe_iterator.h libstdc++: [_GLIBCXX_DEBUG] Remove useless constructor checks 2023-01-23 19:11:54 +01:00
safe_iterator.tcc libstdc++: Fix N3344 behavior on _Safe_iterator::_M_can_advance 2024-03-20 06:38:50 +01:00
safe_local_iterator.h libstdc++: [_GLIBCXX_DEBUG] Remove useless constructor checks 2023-01-23 19:11:54 +01:00
safe_local_iterator.tcc libstdc++: Fix _Safe_local_iterator<>::_M_valid_range 2024-03-20 06:37:09 +01:00
safe_sequence.h Update copyright years. 2023-01-16 11:52:17 +01:00
safe_sequence.tcc Update copyright years. 2023-01-16 11:52:17 +01:00
safe_unordered_base.h Update copyright years. 2023-01-16 11:52:17 +01:00
safe_unordered_container.h Update copyright years. 2023-01-16 11:52:17 +01:00
safe_unordered_container.tcc Update copyright years. 2023-01-16 11:52:17 +01:00
set Update copyright years. 2023-01-16 11:52:17 +01:00
set.h Update copyright years. 2023-01-16 11:52:17 +01:00
stl_iterator.h Update copyright years. 2023-01-16 11:52:17 +01:00
string Update copyright years. 2023-01-16 11:52:17 +01:00
unordered_map libstdc++: Do not define _Insert_base::try_emplace before C++17 2024-12-07 10:08:51 +00:00
unordered_set Update copyright years. 2023-01-16 11:52:17 +01:00
vector Update copyright years. 2023-01-16 11:52:17 +01:00