diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-04-21 19:58:03 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-04-22 17:25:46 +1000 |
commit | 948ea8766780f7e44f39ccde3f2436ac2fec80da (patch) | |
tree | 6494d382be855114fc87d78c3bb8808b08064457 /contrib/clang-format | |
parent | 6e0ffa9e8f36223700ff0cef30ba14305e8a8074 (diff) | |
download | gcc-948ea8766780f7e44f39ccde3f2436ac2fec80da.zip gcc-948ea8766780f7e44f39ccde3f2436ac2fec80da.tar.gz gcc-948ea8766780f7e44f39ccde3f2436ac2fec80da.tar.bz2 |
c++/modules: Find non-exported reachable decls when instantiating friend classes [PR119863]
In r15-9029-geb26b667518c95, we started checking for conflicting
declarations with any reachable decl attached to the same originating
module. This exposed the issue in the PR, where we would always create
a new type even if a matching type existed in the original module.
This patch reworks lookup_imported_hidden_friend to handle this case
better, by first checking for any reachable decl in the attached module
before looking in the mergeable decl slots.
PR c++/119863
gcc/cp/ChangeLog:
* name-lookup.cc (get_mergeable_namespace_binding): Remove
no-longer-used function.
(lookup_imported_hidden_friend): Also look for hidden imported
decls in an attached decl's module.
gcc/testsuite/ChangeLog:
* g++.dg/modules/tpl-friend-18_a.C: New test.
* g++.dg/modules/tpl-friend-18_b.C: New test.
* g++.dg/modules/tpl-friend-18_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'contrib/clang-format')
0 files changed, 0 insertions, 0 deletions