boostorg / boostorg/asio

BOOST_ASIO_HAS_STD_FUTURE_CLASS detection bug on clang-cl

Đang mở
#417 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
1.6k
Fork
485
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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 ` 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`.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.