]> gcc.gnu.org Git - gcc.git/commit
c++/modules: multiple usings of the same decl [PR115194]
authorJason Merrill <jason@redhat.com>
Thu, 13 Jun 2024 01:44:10 +0000 (21:44 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 13 Jun 2024 15:06:14 +0000 (11:06 -0400)
commit8878fecc251762bc32c24e659695557797e03fd9
treeb2e404ed062b060ceb727fe7f7393dd5dfca0a70
parent57113e3db168e19c46ca52ad084790d462eea603
c++/modules: multiple usings of the same decl [PR115194]

add_binding_entity creates an OVERLOAD to represent a using-declaration in
module purview of a declaration in the global module, even for
non-functions, and we were failing to merge that with the original
declaration in name lookup.

It's not clear to me that building the OVERLOAD is what should be happening,
but let's work around it for now pending an overhaul of using-decl handling
for c++/114683.

PR c++/115194

gcc/cp/ChangeLog:

* name-lookup.cc (name_lookup::process_module_binding): Strip an
OVERLOAD from a non-function.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-23_a.C: New test.
* g++.dg/modules/using-23_b.C: New test.
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/modules/using-23_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/using-23_b.C [new file with mode: 0644]
This page took 0.058381 seconds and 6 git commands to generate.