From 0a8eea3d7e9efba6fefb0ac783a8b988bb1feffb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 17 Apr 2022 10:37:09 +0800 Subject: [PATCH] std-coroutine: include for LLVM-15 since std::experimental::coroutine_traits will be removed in LLVM 15, let's prepare for this change by including when compiling clang-15 and up. without this change, when compiling an application using Seastar coroutine, we could run into following warning: /home/kefu/dev/redpanda/src/v/net/server.cc:141:19: error: support for std::experimental::coroutine_traits will be removed in LLVM 15; use std::coroutine_traits instead [-Werror,-Wdeprecated-experimental-coroutine] co_return ss::stop_iteration::yes; ^ /home/kefu/dev/redpanda/build/deps_install/include/seastar/core/std-coroutine.hh:124:7: note: 'coroutine_traits' declared here class coroutine_traits { }; ^ 1 error generated. after this change, the warning is gone. Signed-off-by: Kefu Chai Message-Id: <20220417023709.2387661-1-tchaikov@gmail.com> --- include/seastar/core/std-coroutine.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/seastar/core/std-coroutine.hh b/include/seastar/core/std-coroutine.hh index 841e854aeb6..61110a3d758 100644 --- a/include/seastar/core/std-coroutine.hh +++ b/include/seastar/core/std-coroutine.hh @@ -21,8 +21,8 @@ #pragma once -// Clang currently only supports the TS -#if __has_include() && !defined(__clang__) +// Clang < 15 only supports the TS +#if __has_include() && (!defined(__clang__) || __clang_major__ >= 15) #include #define SEASTAR_INTERNAL_COROUTINE_NAMESPACE std #elif __has_include()