[Bug c++/95677] undefined reference to `(anonymous namespace)::xx'
nathan at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 15 12:28:47 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95677
Nathan Sidwell <nathan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-06-15
--- Comment #6 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Ah, anonymous namespaces have internal linkage (and a program-wide unique
identifier). Their contents have the linkage they have. but because they're
within the anonumous namespace they cannot be named from elsewhere, so they
have internal linkage for implementation purposes.
when we actually gave anonymous namespaces there would be no collisions between
TUs for '<anon>::x'. Now we give it a specific name and adjust the linkages of
their contents.
The C++ FE should adjust the linkage of '<anon>::x' too.
More information about the Gcc-bugs
mailing list