[clang] 0818433 - Remove the outdated feature macro '__cpp_coroutines'

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 22:54:21 PDT 2023


Author: Chuanqi Xu
Date: 2023-03-17T13:52:18+08:00
New Revision: 0818433a5515df24c5d2cd95087e375ba8596cb0

URL: https://github.com/llvm/llvm-project/commit/0818433a5515df24c5d2cd95087e375ba8596cb0
DIFF: https://github.com/llvm/llvm-project/commit/0818433a5515df24c5d2cd95087e375ba8596cb0.diff

LOG: Remove the outdated feature macro '__cpp_coroutines'

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'.

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index ab00724af2fa9..0b39dd1c84f7d 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -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

diff  --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp
index 5dee2c8197c89..ca7f987b78ab5 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -356,9 +356,3 @@
 #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

diff  --git a/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h
index 85281f5a09959..cae4099835d73 100644
--- a/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h
+++ b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h
@@ -1,3 +1,3 @@
-#ifndef __cpp_coroutines
+#ifndef __cpp_impl_coroutine
 #error coroutines must be enabled
 #endif

diff  --git a/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h
index 9312b9ad8926e..bf135a2440662 100644
--- a/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h
+++ b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h
@@ -1,3 +1,3 @@
-#ifdef __cpp_coroutines
+#ifdef __cpp_impl_coroutine
 #error coroutines must NOT be enabled
 #endif


        


More information about the cfe-commits mailing list