Remove the outdated feature macro '__cpp_coroutines'
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 17 Mar 2023 05:37:51 +0000 (13:37 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 17 Mar 2023 05:52:18 +0000 (13:52 +0800)
The feature macro '__cpp_coroutines' is for coroutines TS. And the
coroutines TS is deprecated. So we should remove the feature macro too.

BTW, the corresponding feature macro for standard c++ coroutines is
'__cpp_impl_coroutine'.

clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Lexer/cxx-features.cpp
clang/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h
clang/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h

index ab00724..0b39dd1 100644 (file)
@@ -707,10 +707,6 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
   if (LangOpts.Char8)
     Builder.defineMacro("__cpp_char8_t", "202207L");
   Builder.defineMacro("__cpp_impl_destroying_delete", "201806L");
-
-  // TS features.
-  if (LangOpts.Coroutines)
-    Builder.defineMacro("__cpp_coroutines", "201703L");
 }
 
 /// InitializeOpenCLFeatureTestMacros - Define OpenCL macros based on target
index 5dee2c8..ca7f987 100644 (file)
 #if defined(NO_EXCEPTIONS) ? check(exceptions, 0, 0, 0, 0, 0, 0) : check(exceptions, 199711, 199711, 199711, 199711, 199711, 199711)
 #error "wrong value for __cpp_exceptions"
 #endif
-
-// --- TS features --
-
-#if check(coroutines, 0, 0, 0, 0, 201703, 201703)
-#error "wrong value for __cpp_coroutines"
-#endif