clang 14 only defines __cpp_coroutines with -std=c++2a, it’s undefined with -std=c++17. This results in an undefined macro warning if you don’t check that it’s defined before comparing it to a literal with the -Wundef warning option:
In file included from asio/include/asio.hpp:18:
In file included from asio/include/asio/any_completion_executor.hpp:18:
asio/include/asio/detail/config.hpp:1317:39: error: '__cpp_coroutines' is not defined, evaluates to 0 [-Werror,-Wundef]
# elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
^
This pull request adds the check to avoid the warning.
clang 14 only defines
__cpp_coroutines
with-std=c++2a
, it’s undefined with-std=c++17
. This results in an undefined macro warning if you don’t check that it’s defined before comparing it to a literal with the-Wundef
warning option:This pull request adds the check to avoid the warning.