]> git.ipfire.org Git - thirdparty/gcc.git/commit
[C++] Protect call to copy_attributes_to_builtin (PR91505)
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 13:59:31 +0000 (13:59 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 13:59:31 +0000 (13:59 +0000)
commitac71c66c0f8f737601d34ee7eb813cdfacf83455
treed46a050af0f61c366729b5daee6cc2e9cf875fea
parent29ead7a07315238311838ad74c084d5bebe2f70f
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274799 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/i386/crc32-4.C [new file with mode: 0644]