c++: Export usings referring to global module fragment [PR109679]
commit63b531e6f8783e8624502d890dc422379de47a9a
authorNathaniel Shead <nathanieloshead@gmail.com>
Wed, 3 Jan 2024 04:29:51 +0000 (3 15:29 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sun, 7 Jan 2024 10:05:14 +0000 (7 21:05 +1100)
tree34e2eb1ca5e299ff7470ddb453c5aa06d83abd65
parent7f24446a3cf67d1346c78b4667fba74b73a23302
c++: Export usings referring to global module fragment [PR109679]

This patch stops 'add_binding_entity' from ignoring all names in the
global module fragment, since they should still be exported if named
in an exported using-declaration.

PR c++/109679

gcc/cp/ChangeLog:

* module.cc (depset::hash::add_binding_entity): Don't skip names
in the GMF if they've been exported with a using declaration.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-11.h: New test.
* g++.dg/modules/using-11_a.C: New test.
* g++.dg/modules/using-11_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/using-11.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/using-11_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/using-11_b.C [new file with mode: 0644]