diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-07-19 10:55:52 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-07-19 15:12:27 +0100 |
commit | 465802c0d40adca5fd5b0a2af6ff8a323a55b589 (patch) | |
tree | 84201afac23508847598e7bd7815f187543914a2 /gcc | |
parent | 4a8aab9a23550dbf53d4640fef57c0bd6f6b0129 (diff) | |
download | gcc-465802c0d40adca5fd5b0a2af6ff8a323a55b589.zip gcc-465802c0d40adca5fd5b0a2af6ff8a323a55b589.tar.gz gcc-465802c0d40adca5fd5b0a2af6ff8a323a55b589.tar.bz2 |
c++: Enable __has_builtin for new reference binding built-ins
The new built-ins need to be detectable using __has_builtin, and the
library should use that to check for them.
This fixes an error with Clang when C++23 is enabled.
gcc/cp/ChangeLog:
* cp-objcp-common.cc (names_builtin_p): Return true for
RID_REF_CONSTRUCTS_FROM_TEMPORARY and
RID_REF_CONVERTS_FROM_TEMPORARY.
libstdc++-v3/ChangeLog:
* include/std/type_traits (__cpp_lib_reference_from_temporary)
(reference_constructs_from_temporary)
(reference_converts_from_temporary): Only define when the
built-ins are available.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/cp-objcp-common.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/cp-objcp-common.cc b/gcc/cp/cp-objcp-common.cc index 0b70d55..4079a4b 100644 --- a/gcc/cp/cp-objcp-common.cc +++ b/gcc/cp/cp-objcp-common.cc @@ -461,6 +461,8 @@ names_builtin_p (const char *name) case RID_IS_ASSIGNABLE: case RID_IS_CONSTRUCTIBLE: case RID_UNDERLYING_TYPE: + case RID_REF_CONSTRUCTS_FROM_TEMPORARY: + case RID_REF_CONVERTS_FROM_TEMPORARY: return true; default: break; |