https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118799
Bug ID: 118799
Summary: [15 Regression] [modules] error on typedefs in
anonymous namespace
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nshead at gcc dot gnu.org
Target Milestone: ---
A typedef or alias declaration in a module interface is incorrectly labelled as
an exposure:
// test.cpp
export module M;
namespace {
using A = int;
typedef int B;
}
g++ -fmodules -S test.cpp:
test.cpp:4:9: error: ‘using {anonymous}::A = int’ exposes TU-local entity
‘{anonymous}’
4 | using A = int;
| ^
test.cpp:3:1: note: ‘{anonymous}’ declared with internal linkage
3 | namespace {
| ^~~~~~~~~
test.cpp:5:15: error: ‘{anonymous}::B’ exposes TU-local entity ‘{anonymous}’
5 | typedef int B;
| ^
test.cpp:3:1: note: ‘{anonymous}’ declared with internal linkage
3 | namespace {
| ^~~~~~~~~
A type alias is not an entity and so any exposures in the declaration are not
ill-formed, as this is limited to non-TU-local entities by
https://eel.is/c++draft/basic.link#17.