The MONGO_DECLARE_SHIM macro uses token pasting to attach the current line number to the internal class it defines: https://github.com/mongodb/mongo/blob/8010c51d3f1cc1020959f8b351f8242d141d42a3/src/mongo/base/shim.h#L136-L139
If two files declare shims within the same namespace on the same line, that will be an ODR violation:
- https://github.com/mongodb/mongo/blob/8010c51d3f1cc1020959f8b351f8242d141d42a3/src/mongo/db/s/transaction_coordinator_worker_curop_repository.h#L68
- https://github.com/mongodb/mongo/blob/8010c51d3f1cc1020959f8b351f8242d141d42a3/src/mongo/db/read_concern.h#L68
The DECLARE_SHIM and related macros must find a way to generate names which cannot collide like this, probably by folding some of the file name into the generated name, or by requiring a stringy argument to the macro to disambiguate.