aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-21 13:59:31 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-21 13:59:31 +0000
commit077eb7af6e296e45e8f333f799170685b4d77b03 (patch)
treed46a050af0f61c366729b5daee6cc2e9cf875fea /gcc/cp/decl.c
parentd6dea10acfd9d775f260a2e7c319bb1ee64c0af0 (diff)
downloadgcc-077eb7af6e296e45e8f333f799170685b4d77b03.zip
gcc-077eb7af6e296e45e8f333f799170685b4d77b03.tar.gz
gcc-077eb7af6e296e45e8f333f799170685b4d77b03.tar.bz2
[C++] Protect call to copy_attributes_to_builtin (PR91505)
copy_attributes_to_builtin only handles BUILT_IN_NORMAL, but C++ was calling it immediately after the: if (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL) block. The corresponding C code calls it inside the block instead. 2019-08-21 Richard Sandiford <richard.sandiford@arm.com> gcc/cp/ PR c++/91505 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside the BUILT_IN_NORMAL block rather than afterward. gcc/testsuite/ PR c++/91505 * g++.target/i386/crc32-4.C: New test. From-SVN: r274799
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 08b7baa..88aa69c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2565,9 +2565,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
set_builtin_decl_declared_p (fncode, true);
break;
}
- }
- copy_attributes_to_builtin (newdecl);
+ copy_attributes_to_builtin (newdecl);
+ }
}
if (new_defines_function)
/* If defining a function declared with other language