]> gcc.gnu.org Git - gcc.git/commit
c++: local function versioning [PR104669]
authorJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 20:40:14 +0000 (16:40 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 12 May 2022 20:13:35 +0000 (16:13 -0400)
commit0c45820ead85b8bc6f8283f7692a85d0c12ded4f
tree2d3ace91e2f70b1321e4312d7d7999f0665c9db9
parent394c852a6b4bed8117c790c2cd1553e224975ad5
c++: local function versioning [PR104669]

There were two problems with this testcase: we weren't copying the target
attribute from the second declaration to the global alias for the first
one (duplicate_decls hunk), and then we were treating the third one as
matching the earlier one even though both are versioned (decls_match hunk).
The latter change required a fix to find_last_decl (used for attribute
mismatch warnings) to give up if we see a versioned function, as in that
case we can't determine whether the decls match, because we are still in the
process of setting the attributes on the new decl.

PR c++/104669

gcc/cp/ChangeLog:

* decl.c (decls_match): Compare versions even if not recording.
(duplicate_decls): Propagate attributes to alias.
* decl2.c (find_last_decl): Give up if versioned.

gcc/testsuite/ChangeLog:

* g++.target/i386/mv31.C: New test.
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/testsuite/g++.target/i386/mv31.C [new file with mode: 0644]
This page took 0.051326 seconds and 5 git commands to generate.