aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2b6080064d9..5241f87f4db 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3494,6 +3494,17 @@ builtin_function_1 (const char* name,
anticipated but not actually declared. */
if (name[0] != '_' || name[1] != '_')
DECL_ANTICIPATED (decl) = 1;
+ else if (strncmp (name + 2, "builtin_", strlen ("builtin_")) != 0)
+ {
+ size_t len = strlen (name);
+
+ /* Treat __*_chk fortification functions as anticipated as well,
+ unless they are __builtin_*. */
+ if (len > strlen ("___chk")
+ && memcmp (name + len - strlen ("_chk"),
+ "_chk", strlen ("_chk") + 1) == 0)
+ DECL_ANTICIPATED (decl) = 1;
+ }
/* Possibly apply some default attributes to this built-in function. */
if (attrs)