aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2026-01-31 10:19:26 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2026-01-31 10:19:26 +0100
commitd6386e0984556173339c06b2b7cfe2dd55eeb07b (patch)
treedcddbddf2e7ab6866308c2f61a63cc6941079291 /libjava/classpath/java
parent8b0ccc95f1a70415d50bb87397cf0b1761be1e40 (diff)
downloadgcc-d6386e0984556173339c06b2b7cfe2dd55eeb07b.zip
gcc-d6386e0984556173339c06b2b7cfe2dd55eeb07b.tar.gz
gcc-d6386e0984556173339c06b2b7cfe2dd55eeb07b.tar.bz2
c++: Handle argument merging push_local_extern_decl_alias [PR123825]
The first testcase comes directly from https://eel.is/c++draft/meta.reflection#names-1.8.2 and shows that we don't handle for -freflection the function argument name difference handling isn't performed for local externs, which doesn't go the duplicate_decls route but directly remembers the alias. The following patch handles outlines the DECL_ARGUMENTS handling from duplicate_decls and uses it in push_local_extern_decl_alias (with some minor differences and for now not propagating attributes back for the push_local_extern_decl_alias case unless -freflection). ALso, I found that the addition of a new alias created completely broken DECL_ARGUMENTS (copied at most the first PARM_DECL, never more than that). That is because copy_decl clears DECL_CHAIN, so the loop always stopped after the first iteration. 2026-01-31 Jakub Jelinek <jakub@redhat.com> PR c++/123825 * cp-tree.h (merge_decl_arguments): Declare. * decl.cc (duplicate_decls): Outline DECL_ARGUMENTS handling into ... (merge_decl_arguments): ... new function. * name-lookup.cc (push_local_extern_decl_alias): Call merge_decl_arguments. Don't copy just the first PARM_DECL when creating a new alias FUNCTION_DECL. * g++.dg/reflect/has_identifier3.C: New test. * g++.dg/reflect/identifier_of3.C: New test. * g++.dg/cpp26/attr-indeterminate5.C: New test.
Diffstat (limited to 'libjava/classpath/java')
0 files changed, 0 insertions, 0 deletions