gcc/libstdc++-v3
Jonathan Wakely 6aa1227400 libstdc++: Simplify detection of built-in functions
This fixes a regression affecting the Intel compiler. Because that
compiler defines __GNUC__ to match whatever version of GCC it finds on
the host system, it might claim to be a brand new GCC despite not
actually supporting all the built-ins that the latest GCC supports. This
means the config checks for __GNUC__ don't work. Most recently this
broke when r11-3569-g73ae6eb572515ad627b575a7fbdfdd47a4368e1c switched
us from using __is_same_as to __is_same when __GNUC__ >= 11.

Because __has_builtin is supported by all of GCC, Clang, and Intel we can
use that to reliably detect whether a given built-in is supported,
instead of hardcoding anything based on __GNUC__. The big caveat is
that for versions of Clang <= 9.0.0 and for (as far as I can tell) all
released versions of Intel icc, __has_builtin only evaluates to true for
built-ins with a name starting "__builtin_". For __is_aggregate,
__is_same, and __has_unique_object_representations it's necessary to use
__is_identifier to check if it's a valid identifeir token instead.

The solution used in this patch is to define _GLIBCXX_HAS_BUILTIN and
use that instead of using __has_builtin directly. For compilers that
define __is_identifier as well as __has_builtin we use both, so that if
__has_builtin evaluates to false we try again using !__is_identifier.

libstdc++-v3/ChangeLog:

	* include/bits/c++config (_GLIBCXX_HAS_BUILTIN): Define macro to
	work around different implementations of __has_builtin.
	(_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP)
	(_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE)
	(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED)
	(_GLIBCXX_HAVE_BUILTIN_IS_SAME, _GLIBCXX_HAVE_BUILTIN_LAUNDER):
	Define using _GLIBCXX_HAS_BUILTIN.
2020-12-01 14:14:18 +00:00
..
config libstdc++: Avoid calling undefined __gthread_self weak symbol [PR 95989] 2020-11-19 21:07:06 +00:00
doc libstdc++: Add new C++20 headers to Doxygen settings 2020-11-30 15:02:03 +00:00
include libstdc++: Simplify detection of built-in functions 2020-12-01 14:14:18 +00:00
libsupc++ libstdc++: Use 'inline' consistently in std::exception_ptr [PR 97729] 2020-11-09 14:28:38 +00:00
po
python
scripts libstdc++: Pass CXXFLAGS to check_performance script 2020-10-09 14:01:55 +01:00
src libstdc++: Partially revert r11-5314 2020-11-27 12:25:02 +00:00
testsuite libstdc++: Use longer timeout for slow running tests 2020-12-01 10:51:25 +00:00
acinclude.m4 ada: c++: Get rid of libposix4, librt on Solaris 2020-11-26 13:01:30 +01:00
aclocal.m4
ChangeLog Daily bump. 2020-12-01 00:16:38 +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
config.h.in libstdc++: Add configure checks for semaphores 2020-11-23 18:12:39 +00:00
configure Fix hppa64-hpux11 build to remove source paths from embedded path. 2020-11-29 20:11:38 +00:00
configure.ac
configure.host Scope libstdc++ configuration for vxworks to all versions 2020-10-22 16:40:57 +00:00
crossconfig.m4 Scope libstdc++ configuration for vxworks to all versions 2020-10-22 16:40:57 +00:00
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.