Skip to content

[libc++] atomic_ref implementation does not support const qualified types or volatile types. #98689

@g-valentino

Description

@g-valentino

Godbolt links for the compile errors for const and volatile qualified ints.
libc++ https://godbolt.org/z/nv854jbzf

Same cases but compilation succeeds.
libstdc++ equivalent https://godbolt.org/z/4YoGWaK4h

Looking at atomic ref implementation, seems like the root cause is when declaring the buffer for the atomic builtin to write the value to(e.g. load), the buffer's type is same as the type that instantiated the atomic_ref tempalte.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateResolved as duplicatelibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions