https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112631
Bug ID: 112631 Summary: gcc rejects block-scope declaration of function in a module unit even if the function is attached to the global module fragment Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: michael.kenzel at gmail dot com Target Milestone: --- repro: https://godbolt.org/z/h5f798eEY export module bla; extern "C++" inline void fun() { void oops(); // error: block-scope extern declaration 'void oops()' not permitted in module purview } fun is not attached to a named module due to being declared with a linkage specification (https://eel.is/c++draft/module.unit#7.2). thus, [dcl.meaning.general]/3.5 (https://eel.is/c++draft/dcl.meaning.general#3.5) should not apply.