[PATCH] D119409: [C++20] [Modules] Remain dynamic initializing internal-linkage variables in module interface unit
Iain Sandoe via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 26 13:12:16 PDT 2022
iains added a comment.
I think that this problem might well be a consequence of the bug which is fixed by D122413 <https://reviews.llvm.org/D122413>.
We have been generating code with module internal entities (always) given the special ModuleInternalLinkage (which means that, although the linkage is formally 'internal', the entities are made global when emitted. We should only be doing this for fmodules-ts, not for regular standard modules.
If you apply D122413 <https://reviews.llvm.org/D122413> (which I hope to land soon), then I would expect that iostream should work as expected (with one internal instance of std::__ioinit in each TU that includes iostream).
IFF (after applying D122413 <https://reviews.llvm.org/D122413> ) you add to the command line -fmodules-ts, then the patch here (D119409 <https://reviews.llvm.org/D119409>) would, presumably, be needed to work around multiple instances of the globalised std::__ioinit.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119409/new/
https://reviews.llvm.org/D119409
More information about the cfe-commits
mailing list