https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121574
Nathaniel Shead <nshead at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Summary|[modules] gcc rejects |[modules] Allow suppressing |functions who |errors about exposures of |inline-carries TU-local |TU-local entities |entities in function-body | Last reconfirmed| |2025-08-17 CC| |nshead at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Nathaniel Shead <nshead at gcc dot gnu.org> --- Thanks. As Andrew notes, this is indeed invalid by the standard. Neither Clang nor MSVC (last I checked) implement P1815, which is what requires the diagnostics we give. I'd prefer to keep this as an error because allowing this can silently give bad (unexpected) results; see e.g. https://modules.godbolt.org/z/c9jPjPbq3 for an example of how Clang's behaviour might be confusing. I've also seen spurious linker errors etc. in the past. One thing I've played around with is making GM static entities be an on-by-default pedwarn instead (and having a pragma or attribute to silence this where necessary), to assist with migration in cases where users are willing to risk the dangers or can otherwise prove it behaves correctly for their usecases, because as you say this is useful. But it's been relatively low-priority for me the last few months and is slightly tricky to do safely within the current structure of the streaming logic. Happy to speak further on this if you would like, or review any patches to adjust this behaviour. I'll adjust this PR to instead be about an enhancement request to suppress this error.