On 10/4/25 3:23 AM, Nathaniel Shead wrote:
On Fri, Oct 03, 2025 at 05:29:13PM +0100, Jason Merrill wrote:
On 9/26/25 1:14 PM, Nathaniel Shead wrote:
Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk?
-- >8 --
While investigating another issue I noticed that the condition in
check_module_override seems incorrect: the wording in [basic.link] p11
has no exceptions for internal-linkage entities.
Agreed, it only mentions reachability. But perhaps there should be such an
exception? Do other compilers error on this case? OK if they do.
Thanks. Clang seems happy with this case but MSVC complains:
// a.ixx
export module A;
namespace ns {}
// b.cpp
import A;
static int ns;
$ cl /c /std:c++latest /nologo a.ixx
a.ixx
$ cl /c /std:c++latest /nologo b.cpp
b.cpp
b.cpp(2): error C2365: 'ns': redefinition; previous definition was 'namespace'
...\a.ixx(2): note: see declaration of 'ns'
This change is also needed for the followup to this patch, since in
pushtag the decl is not TREE_PUBLIC until after pushdecl is called.
Though I might be able to find a way around that.
I also don't think this would be particularly useful to allow, as the
definition of 'ns' in b.cpp can be allowed by wrapping it into an
anonymous namespace instead of just marking 'static'. But maybe there's
something I'm missing.
Unless you have any other issues I'll push this patch and its follow-on
sometime next week then.
Makes sense.
Jason