Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of std::atomic_flag::test() added in C++20 compiles successfully with --std=c++17 #57364

Open
magreenblatt opened this issue Aug 25, 2022 · 1 comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@magreenblatt
Copy link

Usage of the std::atomic_flag::test() method added in C++20 should fail to compile with --std=c++17. Instead, it compiles successfully,

I'm not an expert here, but I think the code needs to check the _LIBCPP_STD_VER value.

CC @ogiroux who added this functionality in https://reviews.llvm.org/D68480

@EugeneZelenko EugeneZelenko added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. and removed new issue labels Aug 25, 2022
@JoeLoser
Copy link
Member

This is also a problem for the member functions wait(), notify_one(), and notify_all within std::atomic_flag class it looks like. All of them should be only available for C++20 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

3 participants