Question Details

No question body available.

Tags

c++ c++-modules name-mangling

Answers (1)

March 10, 2026 Score: 6 Rep: 44,714 Quality: High Completeness: 50%

This is the 'strong-ownership model', where the module strongly owns even exported symbols. Windows started with this, and GCC and Clang eventually moved to this due to some benefits seen with adding the module name to the mangling.

See:

https://github.com/itanium-cxx-abi/cxx-abi/pull/144

The strong-ownership model is implemented — the symbols of exported entities with named-module attachment are mangled with a module-name component.

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=73baba1ae1b8f3618c2d3b674117b8a462e0ca76

This implements a strong ownership model, so that exported entities from named modules are mangled to include their module attachment. This gives more informative linker diagnostics and better module isolation. Weak ownership was hoped to allow backwards compatibility with non-modular code, but in practice was very brittle, and C++20 added new semantics for linkage declarations that cover the needed functionality.

https://github.com/llvm/llvm-project/commit/ae4dce8659f313ca2034782583d31993212fa8bd

The hoped-for C++17 compatibility of weak ownership turns out to be fragile