gcc/libstdc++-v3
Jonathan Wakely babaabbcc8 libstdc++: Implement std::unreachable() for C++23 (P0627R6)
This defines std::unreachable as an assertion for debug mode, a trap
when _GLIBCXX_ASSERTIONS is defined, and __builtin_unreachable()
otherwise.

The reason for only using __builtin_trap() in the second case is to
avoid the overhead of setting up a call to __glibcxx_assert_fail that
should never happen.

UBsan can detect if __builtin_unreachable() is executed, so if a feature
test macro for that sanitizer is added, we could change just use
__builtin_unreachable() when the sanitizer is enabled.

While thinking about what the debug assertion failure should print, I
noticed that the __glibcxx_assert_fail function doesn't check for null
pointers. This adds a check so we don't try to print them if null.

libstdc++-v3/ChangeLog:

	* include/std/utility (unreachable): Define for C++23.
	* include/std/version (__cpp_lib_unreachable): Define.
	* src/c++11/debug.cc (__glibcxx_assert_fail): Check for valid
	arguments. Handle only the function being given.
	* testsuite/20_util/unreachable/1.cc: New test.
	* testsuite/20_util/unreachable/version.cc: New test.
2022-04-01 13:17:18 +01:00
..
config libstdc++: Fix symbol versioning for Solaris 11.3 [PR103407] 2022-03-16 21:16:53 +00:00
doc libstdc++: Define std::expected for C++23 (P0323R12) 2022-03-27 18:50:31 +01:00
include libstdc++: Implement std::unreachable() for C++23 (P0627R6) 2022-04-01 13:17:18 +01:00
libsupc++ libstdc++: Add comment about memalign requirements 2022-03-31 16:18:00 +01:00
po
python
scripts
src libstdc++: Implement std::unreachable() for C++23 (P0627R6) 2022-04-01 13:17:18 +01:00
testsuite libstdc++: Implement std::unreachable() for C++23 (P0627R6) 2022-04-01 13:17:18 +01:00
acinclude.m4
aclocal.m4
ChangeLog Daily bump. 2022-04-01 00:16:41 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
config.h.in
configure
configure.ac
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.