-
Notifications
You must be signed in to change notification settings - Fork 416
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
Enable detection for libc++7.0's deprecated <experimental/string_view> #91
Conversation
Confirming that this change fixes the issue for me. My compiler details: clang version 7.0.0 (git@github.com:llvm-mirror/clang.git 297171608bc38595e88b07f52e496cf88c818d42) (git@github.com:llvm-mirror/llvm.git 805514b4e0bf71c6a5c6430e422809e2868b2c52) libcxx revision: 4e177b9 |
I'm guessing this is fixed with b5b17a6 now? |
No, Asio tries to use |
include/boost/asio/detail/config.hpp
Outdated
# define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 | ||
# if defined(_LIBCPP_LFTS_STRING_VIEW) | ||
# define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 | ||
# define BOOST_ASIO_HAS_STD_STRING_VIEW 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant given separate __has_include(<string_view>)
conditional later.
include/boost/asio/detail/config.hpp
Outdated
#if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW) | ||
# if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW) | ||
# if defined(__clang__) | ||
# if (__cplusplus >= 201402) | ||
# if __has_include(<experimental/string_view>) | ||
# define BOOST_ASIO_HAS_STD_STRING_VIEW 1 | ||
# define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 | ||
# if defined(_LIBCPP_LFTS_STRING_VIEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_LIBCPP_LFTS_STRING_VIEW
is the guard defined by #include <experimental/string_view>
but #include
cannot be used without bumping into #error
on libc++ >= 7.
Updated header detection logic. Now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be if (__clang_major__ < 7)
?
Confirming that this patch fixes the issue for me. Tested with boost develop branch and with LLVM 7, LLVM 6 and GCC 8.2.1.
Please merge! Can you also merge this into the last release and provide an update (1.68.1)? Asio and Beast are hardly usable with clang 7 without that patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with boost develop branch and with LLVM 7, LLVM 6 and GCC 8.2.1.
Merging this would be greatly appreciated! |
fixed by 43874d5, please close |
Libc++ 7.0 keeps
<experimental/string_view>
header but deprecates it with an#error
. This patch is intended to fix this problem. Issue #82 should be fixed after applying this patch.