ChuanqiXu updated this revision to Diff 488873.
ChuanqiXu added a comment.
Herald added a subscriber: arichardson.

After failed to reproduce the error locally, try to follow the instructions 
from @philnik to see if the CI-Bot will break.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141572/new/

https://reviews.llvm.org/D141572

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/coroutines.cpp
  libcxx/utils/generate_header_tests.py


Index: libcxx/utils/generate_header_tests.py
===================================================================
--- libcxx/utils/generate_header_tests.py
+++ libcxx/utils/generate_header_tests.py
@@ -19,6 +19,8 @@
 
     "filesystem": "!defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)",
 
+    "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)",
Index: clang/test/Driver/coroutines.cpp
===================================================================
--- clang/test/Driver/coroutines.cpp
+++ clang/test/Driver/coroutines.cpp
@@ -5,5 +5,6 @@
 
 // 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' to use C++20 coroutines instead
 // CHECK-HAS-CORO: -fcoroutines-ts
 
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6449,6 +6449,7 @@
   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");
   }
 
Index: clang/include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -627,6 +627,11 @@
   "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' to use C++20 coroutines instead">,
+  InGroup<DeprecatedExperimentalCoroutine>;
+
 def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
 
 def err_drv_invalid_object_mode : Error<
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -546,6 +546,9 @@
 -----------------------
 - Clang now permits specifying ``--config=`` multiple times, to load multiple
   configuration files.
+- Clang now deprecates the ``-fcoroutines-ts`` flag and the flag will be
+  removed in Clang 17. Please use ``-std=c++20`` to use C++20 coroutines
+  instead.
 
 Removed Compiler Flags
 -------------------------


Index: libcxx/utils/generate_header_tests.py
===================================================================
--- libcxx/utils/generate_header_tests.py
+++ libcxx/utils/generate_header_tests.py
@@ -19,6 +19,8 @@
 
     "filesystem": "!defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)",
 
+    "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)",
Index: clang/test/Driver/coroutines.cpp
===================================================================
--- clang/test/Driver/coroutines.cpp
+++ clang/test/Driver/coroutines.cpp
@@ -5,5 +5,6 @@
 
 // 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' to use C++20 coroutines instead
 // CHECK-HAS-CORO: -fcoroutines-ts
 
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6449,6 +6449,7 @@
   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");
   }
 
Index: clang/include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -627,6 +627,11 @@
   "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' to use C++20 coroutines instead">,
+  InGroup<DeprecatedExperimentalCoroutine>;
+
 def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
 
 def err_drv_invalid_object_mode : Error<
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -546,6 +546,9 @@
 -----------------------
 - Clang now permits specifying ``--config=`` multiple times, to load multiple
   configuration files.
+- Clang now deprecates the ``-fcoroutines-ts`` flag and the flag will be
+  removed in Clang 17. Please use ``-std=c++20`` to use C++20 coroutines
+  instead.
 
 Removed Compiler Flags
 -------------------------
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to