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

BOOST_ASIO_HAS_STD_FUTURE_CLASS detection bug on clang-cl #417

Open
mark-99 opened this issue Apr 13, 2023 · 0 comments
Open

BOOST_ASIO_HAS_STD_FUTURE_CLASS detection bug on clang-cl #417

mark-99 opened this issue Apr 13, 2023 · 0 comments

Comments

@mark-99
Copy link

mark-99 commented Apr 13, 2023

clang-cl on Windows uses the clang compiler with the MSVC STL. In the detection logic here https://github.com/boostorg/asio/blob/develop/include/boost/asio/detail/future.hpp

__GNUC__ is true (as clang sets it)
BOOST_ASIO_HAS_CLANG_LIBCXX is false (as it's MSVC STL)
_GLIBCXX_HAS_GTHREADS is false (as it's not that either)
So this leaves BOOST_ASIO_HAS_STD_FUTURE_CLASS undefined.

This in turn causes #include <boost/asio/packaged_task.hpp> to silently fail to define anything, and that leads to an obscure error message about incomplete types and unexpected void when trying to e.g. post a packaged_task (ie the same error message as if you try to use that functionality without including that header, as now the header is effectively empty).

Workaround is to manually define BOOST_ASIO_HAS_STD_FUTURE_CLASS.

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