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

is_mutex_type<recursive_mutex> is false if BOOST_NO_CXX11_SFINAE_EXPR is defined #370

Open
jwakely opened this issue May 10, 2022 · 1 comment

Comments

@jwakely
Copy link

jwakely commented May 10, 2022

This part of the old has_member_try_lock implementation fails to match recursive_mutex::try_lock() because it's noexcept:

template<typename U>
static true_type has_member(bool (U::*)());
template<typename U>
static false_type has_member(U);

The bug is still there in the current code, but hidden by a35ffa3 which has a working version that is used by most compilers since Boost 1.69.0

A fix would be to add another partial specialization for noexcept functions:

#ifndef BOOST_NO_CXX11_NOEXCEPT
        template<typename U>
        static true_type has_member(bool (U::*)() noexcept);
#endif
@jwakely jwakely changed the title is_mutex_type<recursive_mutex> is false is_mutex_type<recursive_mutex> is false if BOOST_NO_CXX11_SFINAE_EXPR is defined May 10, 2022
@jwakely
Copy link
Author

jwakely commented May 10, 2022

Demo of the bug in 1.66.0: https://godbolt.org/z/hnTrsceTv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant