[clang] 6ed67cc - [Coroutines] Remove -fcoroutines-ts
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 22 22:44:34 PST 2023
Author: Chuanqi Xu
Date: 2023-02-23T14:40:58+08:00
New Revision: 6ed67ccba7e4699e9e42302f2f9b7653444258ba
URL: https://github.com/llvm/llvm-project/commit/6ed67ccba7e4699e9e42302f2f9b7653444258ba
DIFF: https://github.com/llvm/llvm-project/commit/6ed67ccba7e4699e9e42302f2f9b7653444258ba.diff
LOG: [Coroutines] Remove -fcoroutines-ts
Since we decided to remove the support for `-fcoroutines-ts` in
clang/llvm17 and the clang16/llvm16 is branched. So we're going to
remove the `-fcoroutines-ts` option.
Added:
clang/test/Parser/cxx20-coroutines.cpp
Modified:
clang/docs/ReleaseNotes.rst
clang/include/clang/AST/Stmt.h
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/StmtNodes.td
clang/include/clang/Basic/TokenKinds.def
clang/include/clang/Driver/Options.td
clang/include/clang/Sema/Sema.h
clang/lib/AST/StmtPrinter.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Sema/TreeTransform.h
clang/test/AST/Inputs/std-coroutine-exp-namespace.h
clang/test/AST/Inputs/std-coroutine.h
clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c
clang/test/CodeGenCoroutines/coro-builtins-err.c
clang/test/CodeGenCoroutines/coro-builtins.c
clang/test/CodeGenCoroutines/coro-gro2.cpp
clang/test/CodeGenCoroutines/coro-params.cpp
clang/test/CoverageMapping/coroutine.cpp
clang/test/Driver/coroutines.c
clang/test/Driver/coroutines.cpp
clang/test/Index/coroutines.cpp
clang/test/Lexer/coroutines.cpp
clang/test/Lexer/cxx-features.cpp
clang/test/Modules/requires-coroutines.mm
clang/test/PCH/coroutines.cpp
clang/test/SemaCXX/coroutine-builtins.cpp
clang/test/SemaCXX/thread-safety-coro.cpp
Removed:
clang/test/Parser/cxx1z-coroutines.cpp
clang/test/SemaCXX/Inputs/std-coroutine-exp-namespace.h
################################################################################
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 9c89bbc0d1786..be3ea5ff63cde 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -115,6 +115,8 @@ Removed Compiler Flags
-------------------------
- The deprecated flag `-fmodules-ts` is removed. Please use ``-std=c++20``
or higher to use standard C++ modules instead.
+- The deprecated flag `-fcoroutines-ts` is removed. Please use ``-std=c++20``
+ or higher to use standard C++ coroutines instead.
Attribute Changes in Clang
--------------------------
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index b70cf3aec5d6c..45010f19b69b2 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -978,7 +978,7 @@ class alignas(void *) Stmt {
SourceLocation RequiresKWLoc;
};
- //===--- C++ Coroutines TS bitfields classes ---===//
+ //===--- C++ Coroutines bitfields classes ---===//
class CoawaitExprBitfields {
friend class CoawaitExpr;
@@ -1082,7 +1082,7 @@ class alignas(void *) Stmt {
LambdaExprBitfields LambdaExprBits;
RequiresExprBitfields RequiresExprBits;
- // C++ Coroutines TS expressions
+ // C++ Coroutines expressions
CoawaitExprBitfields CoawaitBits;
// Obj-C Expressions
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 77fb1e00585a0..4c922650e100f 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -637,11 +637,6 @@ def warn_drv_libstdcxx_not_found : Warning<
"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<
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 17fdcffa2d427..d56aba34ac0a3 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -60,10 +60,8 @@ def CompoundTokenSplit : DiagGroup<"compound-token-split",
CompoundTokenSplitBySpace]>;
def CoroutineMissingUnhandledException :
DiagGroup<"coroutine-missing-unhandled-exception">;
-def DeprecatedExperimentalCoroutine :
- DiagGroup<"deprecated-experimental-coroutine">;
def DeprecatedCoroutine :
- DiagGroup<"deprecated-coroutine", [DeprecatedExperimentalCoroutine]>;
+ DiagGroup<"deprecated-coroutine">;
def AlwaysInlineCoroutine :
DiagGroup<"always-inline-coroutine">;
def CoroNonAlignedAllocationFunction :
diff --git a/clang/include/clang/Basic/StmtNodes.td b/clang/include/clang/Basic/StmtNodes.td
index eeec01dd8c84d..4b31e06eb2cdb 100644
--- a/clang/include/clang/Basic/StmtNodes.td
+++ b/clang/include/clang/Basic/StmtNodes.td
@@ -50,7 +50,7 @@ def CXXCatchStmt : StmtNode<Stmt>;
def CXXTryStmt : StmtNode<Stmt>;
def CXXForRangeStmt : StmtNode<Stmt>;
-// C++ Coroutines TS statements
+// C++ Coroutines statements
def CoroutineBodyStmt : StmtNode<Stmt>;
def CoreturnStmt : StmtNode<Stmt>;
@@ -162,7 +162,7 @@ def LambdaExpr : StmtNode<Expr>;
def CXXFoldExpr : StmtNode<Expr>;
def CXXParenListInitExpr: StmtNode<Expr>;
-// C++ Coroutines TS expressions
+// C++ Coroutines expressions
def CoroutineSuspendExpr : StmtNode<Expr, 1>;
def CoawaitExpr : StmtNode<CoroutineSuspendExpr>;
def DependentCoawaitExpr : StmtNode<Expr>;
diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def
index b9da4711a5c2d..aa6951e68ebc2 100644
--- a/clang/include/clang/Basic/TokenKinds.def
+++ b/clang/include/clang/Basic/TokenKinds.def
@@ -394,7 +394,7 @@ CXX11_KEYWORD(nullptr , KEYC2X)
CXX11_KEYWORD(static_assert , KEYMSCOMPAT|KEYC2X)
CXX11_KEYWORD(thread_local , KEYC2X)
-// C++20 / coroutines TS keywords
+// C++20 / coroutines keywords
COROUTINES_KEYWORD(co_await)
COROUTINES_KEYWORD(co_return)
COROUTINES_KEYWORD(co_yield)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index a25854daf6a1b..5b6c0e6e914d0 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1241,10 +1241,10 @@ defm autolink : BoolFOption<"autolink",
def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">;
-// C++ Coroutines TS
-defm coroutines_ts : BoolFOption<"coroutines-ts",
+// C++ Coroutines
+defm coroutines : BoolFOption<"coroutines",
LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
- PosFlag<SetTrue, [CC1Option], "Enable support for the C++ Coroutines TS">,
+ PosFlag<SetTrue, [CC1Option], "Enable support for the C++ Coroutines">,
NegFlag<SetFalse>>;
defm coro_aligned_allocation : BoolFOption<"coro-aligned-allocation",
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index ecc031ce116e6..41691eab4972b 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -10868,7 +10868,7 @@ class Sema final {
bool checkNSReturnsRetainedReturnType(SourceLocation loc, QualType type);
//===--------------------------------------------------------------------===//
- // C++ Coroutines TS
+ // C++ Coroutines
//
bool ActOnCoroutineBodyStart(Scope *S, SourceLocation KwLoc,
StringRef Keyword);
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 552789ad81142..bc618e2e53d06 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -2539,7 +2539,7 @@ void StmtPrinter::VisitRequiresExpr(RequiresExpr *E) {
OS << "}";
}
-// C++ Coroutines TS
+// C++ Coroutines
void StmtPrinter::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) {
Visit(S->getBody());
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 3703a1e78d8b2..d6339541ae17a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6530,13 +6530,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (TC.IsEncodeExtendedBlockSignatureDefault())
CmdArgs.push_back("-fencode-extended-block-signature");
- 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");
- }
-
if (Args.hasFlag(options::OPT_fcoro_aligned_allocation,
options::OPT_fno_coro_aligned_allocation, false) &&
types::isCXX(InputType))
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 09b4ac814c4d9..44326d705cfd2 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -7944,8 +7944,7 @@ TreeTransform<Derived>::TransformMSAsmStmt(MSAsmStmt *S) {
TransformedExprs, S->getEndLoc());
}
-// C++ Coroutines TS
-
+// C++ Coroutines
template<typename Derived>
StmtResult
TreeTransform<Derived>::TransformCoroutineBodyStmt(CoroutineBodyStmt *S) {
diff --git a/clang/test/AST/Inputs/std-coroutine-exp-namespace.h b/clang/test/AST/Inputs/std-coroutine-exp-namespace.h
index 8234a19cba139..2aa5bbf93e101 100644
--- a/clang/test/AST/Inputs/std-coroutine-exp-namespace.h
+++ b/clang/test/AST/Inputs/std-coroutine-exp-namespace.h
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
#ifndef STD_COROUTINE_H
#define STD_COROUTINE_H
diff --git a/clang/test/AST/Inputs/std-coroutine.h b/clang/test/AST/Inputs/std-coroutine.h
index 98ddb91a60082..c3ce6543ea5db 100644
--- a/clang/test/AST/Inputs/std-coroutine.h
+++ b/clang/test/AST/Inputs/std-coroutine.h
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 -fcoroutines-ts -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
#ifndef STD_COROUTINE_H
#define STD_COROUTINE_H
diff --git a/clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c b/clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c
index 548f331899a81..381803a00ede7 100644
--- a/clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c
+++ b/clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c
@@ -1,7 +1,7 @@
// Test that no passes are skipped under NPM with -O0/opt-bisect
//
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=address 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=hwaddress 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=memory 2>&1 | FileCheck %s
@@ -12,7 +12,7 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fmemory-profile 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=address 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=hwaddress 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=memory 2>&1 | FileCheck %s
diff --git a/clang/test/CodeGenCoroutines/coro-builtins-err.c b/clang/test/CodeGenCoroutines/coro-builtins-err.c
index 17a29dd04ca20..37312bba563b6 100644
--- a/clang/test/CodeGenCoroutines/coro-builtins-err.c
+++ b/clang/test/CodeGenCoroutines/coro-builtins-err.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines-ts -emit-llvm %s -o - -verify
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines -emit-llvm %s -o - -verify
void f(void) {
__builtin_coro_alloc(); // expected-error {{this builtin expect that __builtin_coro_id}}
diff --git a/clang/test/CodeGenCoroutines/coro-builtins.c b/clang/test/CodeGenCoroutines/coro-builtins.c
index 316ca4250a7ed..e58820db67839 100644
--- a/clang/test/CodeGenCoroutines/coro-builtins.c
+++ b/clang/test/CodeGenCoroutines/coro-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines-ts -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s
void *myAlloc(long long);
diff --git a/clang/test/CodeGenCoroutines/coro-gro2.cpp b/clang/test/CodeGenCoroutines/coro-gro2.cpp
index bb52d21af746c..b0faa66edd333 100644
--- a/clang/test/CodeGenCoroutines/coro-gro2.cpp
+++ b/clang/test/CodeGenCoroutines/coro-gro2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++20 -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s
#include "Inputs/coroutine.h"
diff --git a/clang/test/CodeGenCoroutines/coro-params.cpp b/clang/test/CodeGenCoroutines/coro-params.cpp
index 44753c6a7ba77..09b3b6d583738 100644
--- a/clang/test/CodeGenCoroutines/coro-params.cpp
+++ b/clang/test/CodeGenCoroutines/coro-params.cpp
@@ -150,8 +150,7 @@ void call_dependent_params() {
}
// Test that, when the promise type has a constructor whose signature matches
-// that of the coroutine function, that constructor is used. This is an
-// experimental feature that will be proposed for the Coroutines TS.
+// that of the coroutine function, that constructor is used.
struct promise_matching_constructor {};
diff --git a/clang/test/CoverageMapping/coroutine.cpp b/clang/test/CoverageMapping/coroutine.cpp
index da38acc442be2..0105005d198a1 100644
--- a/clang/test/CoverageMapping/coroutine.cpp
+++ b/clang/test/CoverageMapping/coroutine.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping %s -o - | FileCheck %s
+// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -triple x86_64-unknown-linux-gnu -std=c++20 -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping %s -o - | FileCheck %s
namespace std {
template <typename... T>
diff --git a/clang/test/Driver/coroutines.c b/clang/test/Driver/coroutines.c
index d61023450ad1e..eee6fb6bdc1a5 100644
--- a/clang/test/Driver/coroutines.c
+++ b/clang/test/Driver/coroutines.c
@@ -1,6 +1,3 @@
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// RUN: %clang -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// RUN: %clang -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// CHECK-NO-CORO-NOT: -fcoroutines-ts
+// CHECK-NO-CORO-NOT: -fcoroutines
diff --git a/clang/test/Driver/coroutines.cpp b/clang/test/Driver/coroutines.cpp
index ae5f268994ed5..f2ee480f04b2c 100644
--- a/clang/test/Driver/coroutines.cpp
+++ b/clang/test/Driver/coroutines.cpp
@@ -1,10 +1,2 @@
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// RUN: %clang -fcoroutines-ts -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// RUN: %clang -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s
-// CHECK-NO-CORO-NOT: -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
-
+// CHECK-NO-CORO-NOT: -fcoroutines
diff --git a/clang/test/Index/coroutines.cpp b/clang/test/Index/coroutines.cpp
index 9adda03ebc187..eafca475419b7 100644
--- a/clang/test/Index/coroutines.cpp
+++ b/clang/test/Index/coroutines.cpp
@@ -1,4 +1,4 @@
-// RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s
+// RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -std=c++20 -I%S/../SemaCXX/Inputs | FileCheck %s
#include "std-coroutine.h"
using std::suspend_always;
diff --git a/clang/test/Lexer/coroutines.cpp b/clang/test/Lexer/coroutines.cpp
index 186c84b36ed6f..261f34e75a21b 100644
--- a/clang/test/Lexer/coroutines.cpp
+++ b/clang/test/Lexer/coroutines.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only %s
-// RUN: %clang_cc1 -fcoroutines-ts -DCORO -fsyntax-only %s
+// RUN: %clang_cc1 -std=c++20 -DCORO -fsyntax-only %s
#ifdef CORO
#define CORO_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME)
diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp
index 4a2bf56450df8..5dee2c8197c89 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -8,7 +8,6 @@
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -DCONCEPTS_TS=1 -verify %s
// RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
-// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
// RUN: %clang_cc1 -std=c++14 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
// RUN: %clang_cc1 -std=c++2a -fno-char8_t -DNO_EXCEPTIONS -DNO_CHAR8_T -verify -fsized-deallocation %s
@@ -360,6 +359,6 @@
// --- TS features --
-#if defined(COROUTINES) ? check(coroutines, 201703, 201703, 201703, 201703, 201703, 201703) : check(coroutines, 0, 0, 0, 0, 201703, 201703)
+#if check(coroutines, 0, 0, 0, 0, 201703, 201703)
#error "wrong value for __cpp_coroutines"
#endif
diff --git a/clang/test/Modules/requires-coroutines.mm b/clang/test/Modules/requires-coroutines.mm
index 4e9c9d19cd800..21b8b8b097e91 100644
--- a/clang/test/Modules/requires-coroutines.mm
+++ b/clang/test/Modules/requires-coroutines.mm
@@ -1,13 +1,6 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -Wno-private-module -F %S/Inputs -I %S/Inputs/DependsOnModule.framework %s -verify
-// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -Wno-private-module -F %S/Inputs -I %S/Inputs/DependsOnModule.framework %s -verify -fcoroutines-ts -DCOROUTINES
-#ifdef COROUTINES
- at import DependsOnModule.Coroutines;
-// expected-error at module.map:29 {{module 'DependsOnModule.NotCoroutines' is incompatible with feature 'coroutines'}}
- at import DependsOnModule.NotCoroutines; // expected-note {{module imported here}}
-#else
@import DependsOnModule.NotCoroutines;
// expected-error at module.map:25 {{module 'DependsOnModule.Coroutines' requires feature 'coroutines'}}
@import DependsOnModule.Coroutines; // expected-note {{module imported here}}
-#endif
diff --git a/clang/test/PCH/coroutines.cpp b/clang/test/PCH/coroutines.cpp
index e5e84d01a7de1..55c098bc27a70 100644
--- a/clang/test/PCH/coroutines.cpp
+++ b/clang/test/PCH/coroutines.cpp
@@ -1,9 +1,9 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %s -verify -std=c++1z -fcoroutines-ts %s
+// RUN: %clang_cc1 -include %s -verify -std=c++20 %s
// Test with pch.
-// RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -emit-pch -o %t %s
-// RUN: %clang_cc1 -include-pch %t -verify -std=c++1z -fcoroutines-ts %s
+// RUN: %clang_cc1 -std=c++20 -emit-pch -o %t %s
+// RUN: %clang_cc1 -include-pch %t -verify -std=c++20 %s
#ifndef HEADER
#define HEADER
diff --git a/clang/test/Parser/cxx1z-coroutines.cpp b/clang/test/Parser/cxx20-coroutines.cpp
similarity index 82%
rename from clang/test/Parser/cxx1z-coroutines.cpp
rename to clang/test/Parser/cxx20-coroutines.cpp
index 68ef91c81727e..7207fb98587ab 100644
--- a/clang/test/Parser/cxx1z-coroutines.cpp
+++ b/clang/test/Parser/cxx20-coroutines.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fcoroutines-ts %s -verify
+// RUN: %clang_cc1 -std=c++20 %s -verify
template<typename T, typename U>
U f(T t) {
@@ -11,7 +11,7 @@ U f(T t) {
auto x = co_await t;
auto y = co_yield t;
- for co_await (int x : t) {}
+ for co_await (int x : t) {} // expected-warning {{'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated}}
for co_await (int x = 0; x != 10; ++x) {} // expected-error {{'co_await' modifier can only be applied to range-based for loop}}
if (t)
diff --git a/clang/test/SemaCXX/Inputs/std-coroutine-exp-namespace.h b/clang/test/SemaCXX/Inputs/std-coroutine-exp-namespace.h
deleted file mode 100644
index 27702b516fafc..0000000000000
--- a/clang/test/SemaCXX/Inputs/std-coroutine-exp-namespace.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
-#ifndef STD_COROUTINE_EXPERIMENTAL_H
-#define STD_COROUTINE_EXPERIMENTAL_H
-
-namespace std {
-namespace experimental {
-template <class Ret, typename... T>
-struct coroutine_traits { using promise_type = typename Ret::promise_type; };
-
-template <class Promise = void>
-struct coroutine_handle {
- static coroutine_handle from_address(void *) noexcept;
-};
-template <>
-struct coroutine_handle<void> {
- template <class PromiseType>
- coroutine_handle(coroutine_handle<PromiseType>) noexcept;
- static coroutine_handle from_address(void *);
-};
-
-struct suspend_always {
- bool await_ready() noexcept { return false; }
- void await_suspend(coroutine_handle<>) noexcept {}
- void await_resume() noexcept {}
-};
-
-struct suspend_never {
- bool await_ready() noexcept { return true; }
- void await_suspend(coroutine_handle<>) noexcept {}
- void await_resume() noexcept {}
-};
-} // namespace experimental
-} // namespace std
-
-#endif // STD_COROUTINE_EXPERIMENTAL_H
diff --git a/clang/test/SemaCXX/coroutine-builtins.cpp b/clang/test/SemaCXX/coroutine-builtins.cpp
index 7fa1b49172c2f..f2d0eda37d707 100644
--- a/clang/test/SemaCXX/coroutine-builtins.cpp
+++ b/clang/test/SemaCXX/coroutine-builtins.cpp
@@ -1,4 +1,3 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fcoroutines-ts %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
// RUN: %clang_cc1 -fsyntax-only -verify -DERRORS %s
diff --git a/clang/test/SemaCXX/thread-safety-coro.cpp b/clang/test/SemaCXX/thread-safety-coro.cpp
index 9d40c3bf492a5..349efcfa7eb05 100644
--- a/clang/test/SemaCXX/thread-safety-coro.cpp
+++ b/clang/test/SemaCXX/thread-safety-coro.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++17 -fcoroutines-ts %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++20 %s
// expected-no-diagnostics
More information about the cfe-commits
mailing list