gcc/libstdc++-v3
Jonathan Wakely 3633cc5428 libstdc++: Implement P1328 "Making std::type_info::operator== constexpr"
This feature is present in the C++23 draft.

With Jakub's recent front-end changes we can implement constexpr
equality by comparing the addresses of std::type_info objects. We do not
need string comparisons, because for constant evaluation cases we know
we aren't dealing with std::type_info objects defined in other
translation units.

The ARM EABI requires that the type_info::operator== function can be
defined out-of-line (and suggests that should be the default), but to be
a constexpr function it must be defined inline (at least for C++23
mode). To meet these conflicting requirements we make the inline version
of operator== call a new __equal function when called at runtime. That
is an alias for the non-inline definition of operator== defined in
libsupc++.

libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.30): Export new symbol for
	ARM EABI.
	* include/bits/c++config (_GLIBCXX23_CONSTEXPR): Define.
	* include/std/version (__cpp_lib_constexpr_typeinfo): Define.
	* libsupc++/tinfo.cc: Add #error to ensure non-inline definition
	is emitted.
	(type_info::__equal): Define alias symbol.
	* libsupc++/typeinfo (type_info::before): Combine different
	implementations into one.
	(type_info::operator==): Likewise. Use address equality for
	constant evaluation. Call __equal for targets that require the
	definition to be non-inline.
	* testsuite/18_support/type_info/constexpr.cc: New test.
2022-01-05 14:43:01 +00:00
..
config libstdc++: Implement P1328 "Making std::type_info::operator== constexpr" 2022-01-05 14:43:01 +00:00
doc libstdc++: Fix example preprocessor command in FAQ [PR103877] 2022-01-05 13:47:01 +00:00
include libstdc++: Implement P1328 "Making std::type_info::operator== constexpr" 2022-01-05 14:43:01 +00:00
libsupc++ libstdc++: Implement P1328 "Making std::type_info::operator== constexpr" 2022-01-05 14:43:01 +00:00
po Update copyright years. 2022-01-03 10:42:10 +01:00
python libstdc++: Fix std::error_code pretty printer for versioned namespace 2022-01-05 14:17:50 +00:00
scripts Update copyright years. 2022-01-03 10:42:10 +01:00
src libstdc++: Improvements to standard error category objects (part deux) 2022-01-05 14:17:51 +00:00
testsuite libstdc++: Implement P1328 "Making std::type_info::operator== constexpr" 2022-01-05 14:43:01 +00:00
acinclude.m4 libstdc++: Fix definition of _GLIBCXX_NO_SLEEP config macro 2021-12-10 14:05:46 +00:00
aclocal.m4
ChangeLog Rotate ChangeLog files - step 2 - remove 2021 entries from ChangeLog files. 2022-01-03 10:23:34 +01: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 libstdc++: Fix typo in ChangeLog-2020 2021-01-13 11:02:13 +00:00
ChangeLog-2021 Rotate ChangeLog files - part 1 - add ChangeLog-2021. 2022-01-03 10:18:16 +01:00
config.h.in libstdc++: Fix definition of _GLIBCXX_NO_SLEEP config macro 2021-12-10 14:05:46 +00:00
configure libstdc++: Fix definition of _GLIBCXX_NO_SLEEP config macro 2021-12-10 14:05:46 +00:00
configure.ac libstdc++: Support getentropy and arc4random in std::random_device 2021-11-09 14:40:33 +00:00
configure.host Scope libstdc++ configuration for vxworks to all versions 2020-10-22 16:40:57 +00:00
crossconfig.m4 libstdc++: Check for TLS support on mingw cross-compilers 2021-09-15 09:49:33 +01:00
fragment.am libstdc++: Add C++ runtime support for new 128-bit long double format 2020-12-16 23:25:01 +00:00
linkage.m4
Makefile.am Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.in libstdc++: Add C++ runtime support for new 128-bit long double format 2020-12-16 23:25:01 +00:00
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.