--- shared Object i; atomicLoad(i); --- When compiled on DMD 2.109.1, with `-preview=nosharedaccess`, results in: core/internal/atomic.d(155): Error: direct access to shared `*cast(shared(inout(Object))*)resultValuePtr` is not allowed, see `core.atomic` Note that, although the DRuntime implementation differs, LDC produces a similar error.
A quick look shows that core.* has no exception for this message. I'm going to try and add an exclusion specifically for core.internal.atomic as that is a compiler implementation detail of the platform.
@rikkimax created dlang/dmd pull request #17053 "Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess" fixing this issue: - Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess https://github.com/dlang/dmd/pull/17053
dlang/dmd pull request #17053 "Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess" was merged into stable: - ace7cea7731f493d11f906dde1fe5a7a793523a2 by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess https://github.com/dlang/dmd/pull/17053
dlang/dmd pull request #17069 "Merge stable" was merged into master: - a7c85ec3be036e87a6fd76e0d4cd0fba36dd1e07 by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess https://github.com/dlang/dmd/pull/17069