-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
std::atomic_ref::load() should work with a const value.
The following code should compile.
#include <atomic>
int main()
{
int const x = 10;
return std::atomic_ref(x).load();
}
This is not a shallow const issue, but an implementation bug, where the exact type of the value is used rather than removing the cv qualifiers before calling __atomic_load
. This seems reasonable from the specification, the fact that load() is const for std::atomic, and the above code compiles if we use libstdc++ with clang, gcc, icc, or msvc.
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.