https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114683
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:609764a42f0cd3f6358562cab98fc220d3d2d9fd commit r15-1297-g609764a42f0cd3f6358562cab98fc220d3d2d9fd Author: Jason Merrill <ja...@redhat.com> Date: Wed Jun 12 18:24:35 2024 -0400 c++/modules: export using across namespace [PR114683] Currently we represent a non-function using-declaration by inserting the named declaration into the target scope. In general this works fine, but in the case of an exported using-declaration we have nowhere to mark the using-declaration as exported, so we mark the original declaration as exported instead, and then treat all using-declarations that name it as exported as well. We were doing this only if there was also a previous non-exported using, so for this testcase the export got lost; this patch broadens the workaround to also apply to the using that first brings the declaration into the current scope. This does not fully resolve 114683, but replaces a missing exports bug with an extra exports bug, which should be a significant usability improvement. The testcase has xfails for extra exports. I imagine a complete fix should involve inserting a USING_DECL. PR c++/114683 gcc/cp/ChangeLog: * name-lookup.cc (do_nonmember_using_decl): Allow exporting a newly inserted decl. gcc/testsuite/ChangeLog: * g++.dg/modules/using-22_a.C: New test. * g++.dg/modules/using-22_b.C: New test.