Skip to content

stdatomic.h is not working in C mode (15.0.0) #57710

@ngg

Description

@ngg

libc++ 15.0.0 added the new stdatomic.h file: https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/libcxx/include/stdatomic.h

This file has a before C++23 compatibility code which should include other stdatomic.h file shipped elsewhere: https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/libcxx/include/stdatomic.h#L223-L231.

Unfortunately, this is not triggered when in C mode, because the _LIBCPP_COMPILER_CLANG_BASED is only set in __config within an #ifdef __cplusplus region: https://github.com/llvm/llvm-project/blob/llvmorg-15.0.0/libcxx/include/__config#L25

Most other header files that should be working from C code as well use #include_next directives unconditionally or when __cplusplus is not defined. Here are some working examples:

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++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