You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected this code-snippet to compile successfully.
We should be able to use std::atomic_ref<volatile int> to read/write atomically to storage pointed to by a volatile int*. e.g. for storage mapped in via shared-memory.
STL version
Whatever is running in the current compiler-explorer under 'x64 msvc v19.latest'.
Diagnostic paths include '14.39.33321-Pre'
Thanks @pinskia - this is definitely blocked on LWG-3508 that @CaseyCarter filed back in 2020. That needs to be resolved before we'll know what to do here.
Describe the bug
The following code-snippet fails to compile under latest MSVC.
See https://godbolt.org/z/f5jP7zs5G
Expected behavior
I expected this code-snippet to compile successfully.
We should be able to use
std::atomic_ref<volatile int>
to read/write atomically to storage pointed to by avolatile int*
. e.g. for storage mapped in via shared-memory.STL version
Whatever is running in the current compiler-explorer under 'x64 msvc v19.latest'.
Diagnostic paths include '14.39.33321-Pre'
Additional context
Also potentially related - see Wg21 mailing list thread on potential specification issue relating to
std::atomic_ref<volatile T>
.https://lists.isocpp.org/lib/2024/06/28451.php
Other standard libraries also seem to have similar issues:
atomic_ref<const T>
andatomic_ref<volatile T>
fails with a compilation error llvm/llvm-project#94879The text was updated successfully, but these errors were encountered: