The following code: ``` module oops; extern(C): shared static this () { // Do stuff } ``` Will emit the shared module constructor as `_sharedStaticDtor_L4_C1`. Should another module have a similar definition, those functions would conflict. There is no reason for module constructors / destructors to have C linkage, and its potential for symbol conflict means it should be deprecated.
@Geod24 created dlang/dmd pull request #10858 "Fix issue 20627: Module ctors / dtors should always have D linkage" fixing this issue: - Fix issue 20627: Module ctors / dtors should always have D linkage See the changelog for the rationale of this change (or the issue). https://github.com/dlang/dmd/pull/10858
@Geod24 updated dlang/dmd pull request #10834 "Fix issue 20607 - Module constructors are visible as regular function" fixing this issue: - Fix issue 20627: Module ctors / dtors should always have D linkage See the changelog for the rationale of this change (or the issue). https://github.com/dlang/dmd/pull/10834
dlang/dmd pull request #10858 "Fix issue 20627: Module ctors / dtors should always have D linkage" was merged into master: - 786fdf10317b25ed5b85ae07e918dc5627b7ab27 by Geod24: Fix issue 20627: Module ctors / dtors should always have D linkage See the changelog for the rationale of this change (or the issue). https://github.com/dlang/dmd/pull/10858