https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119983
--- Comment #3 from Nathaniel Shead <nshead at gcc dot gnu.org> --- I will note that making the variable internal linkage will silence GCC 15, since a TU-local variable itself is not an exposure; this is appropriate if you only need the variable within that TU. For example, adjusting your original testcase, the following sample is valid: export module M; static struct { void aRandomFunc() { } } variableWithNamelessType{}; export void foo() { variableWithNamelessType.aRandomFunc(); }