has been deprecated. The flag will be removed in Clang 18.
``-ftrivial-auto-var-init=zero`` is now available unconditionally, to be
compatible with GCC.
+- ``-fcoroutines-ts`` has been deprecated. The flag will be removed in Clang 17.
+ Please use ``-std=c++20`` or higher to use standard C++ coroutines instead.
Modified Compiler Flags
-----------------------
"command line to use the libc++ standard library instead">,
InGroup<DiagGroup<"stdlibcxx-not-found">>;
+def warn_deperecated_fcoroutines_ts_flag : Warning<
+ "the '-fcoroutines-ts' flag is deprecated and it will be removed in Clang 17; "
+ "use '-std=c++20' or higher to use standard C++ coroutines instead">,
+ InGroup<DeprecatedExperimentalCoroutine>;
+
def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
def err_drv_invalid_object_mode : Error<
if (Args.hasFlag(options::OPT_fcoroutines_ts, options::OPT_fno_coroutines_ts,
false) &&
types::isCXX(InputType)) {
+ D.Diag(diag::warn_deperecated_fcoroutines_ts_flag);
CmdArgs.push_back("-fcoroutines-ts");
}
// RUN: %clang -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s
// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s
+// CHECK-HAS-CORO: the '-fcoroutines-ts' flag is deprecated and it will be removed in Clang 17; use '-std=c++20' or higher to use standard C++ coroutines instead
// CHECK-HAS-CORO: -fcoroutines-ts
#endif
// RUN: %{build} -DTEST_26
-#if defined(TEST_26)
+#if defined(TEST_26) && (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
# include <coroutine>
using HandlerType = decltype(std::__libcpp_verbose_abort);
#endif
#include <complex.h>
#include <concepts>
#include <condition_variable>
-#include <coroutine>
+#if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
+# include <coroutine>
+#endif
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <complex.h>
#include <concepts>
#include <condition_variable>
-#include <coroutine>
+#if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
+# include <coroutine>
+#endif
#include <csetjmp>
#include <csignal>
#include <cstdarg>
TEST_MACROS();
#include <condition_variable>
TEST_MACROS();
-#include <coroutine>
+#if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
+# include <coroutine>
TEST_MACROS();
+#endif
#include <csetjmp>
TEST_MACROS();
#include <csignal>
#include <condition_variable>
#endif
// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_26
-#if defined(TEST_26)
+#if defined(TEST_26) && (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
#include <coroutine>
#endif
// RUN: %{cxx} %s %{flags} %{compile_flags} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only -DTEST_27
#include <complex.h>
#include <concepts>
#include <condition_variable>
-#include <coroutine>
+#if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
+# include <coroutine>
+#endif
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <complex.h>
#include <concepts>
#include <condition_variable>
-#include <coroutine>
+#if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)
+# include <coroutine>
+#endif
#include <csetjmp>
#include <csignal>
#include <cstdarg>
"filesystem": "!defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)",
+ # TODO LLVM17: simplify this to __cplusplus >= 202002L
+ "coroutine": "(defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L)",
+
"clocale": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"codecvt": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"fstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_FSTREAM)",