aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2022-08-29 16:54:05 -0400
committerMarek Polacek <polacek@redhat.com>2022-08-30 09:05:29 -0400
commitfe915f35b7d8dc768a2b977c09aa02f933e1d1e9 (patch)
treed8a5538a61cc4de4e1ac9e3ff6073d55d9d08ada /gcc/cp
parent7e3f18439904bf26eabc658caf843b297a052eb4 (diff)
downloadgcc-fe915f35b7d8dc768a2b977c09aa02f933e1d1e9.zip
gcc-fe915f35b7d8dc768a2b977c09aa02f933e1d1e9.tar.gz
gcc-fe915f35b7d8dc768a2b977c09aa02f933e1d1e9.tar.bz2
c++: __has_builtin gives the wrong answer [PR106759]
We've supported __is_nothrow_constructible since r11-4386, but names_builtin_p didn't know about it, so it gave the wrong answer for #if __has_builtin(__is_nothrow_constructible) ... #endif I've tested all C++-only built-ins and only two were missing. PR c++/106759 gcc/cp/ChangeLog: * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE and RID_IS_NOTHROW_CONSTRUCTIBLE. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/cp-objcp-common.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/cp-objcp-common.cc b/gcc/cp/cp-objcp-common.cc
index 4079a4b..1ffac08 100644
--- a/gcc/cp/cp-objcp-common.cc
+++ b/gcc/cp/cp-objcp-common.cc
@@ -460,6 +460,8 @@ names_builtin_p (const char *name)
case RID_IS_UNION:
case RID_IS_ASSIGNABLE:
case RID_IS_CONSTRUCTIBLE:
+ case RID_IS_NOTHROW_ASSIGNABLE:
+ case RID_IS_NOTHROW_CONSTRUCTIBLE:
case RID_UNDERLYING_TYPE:
case RID_REF_CONSTRUCTS_FROM_TEMPORARY:
case RID_REF_CONVERTS_FROM_TEMPORARY: