From: Chuanqi Xu Date: Fri, 17 Mar 2023 05:37:51 +0000 (+0800) Subject: Remove the outdated feature macro '__cpp_coroutines' X-Git-Tag: upstream/17.0.6~14506 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0818433a5515df24c5d2cd95087e375ba8596cb0;p=platform%2Fupstream%2Fllvm.git 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'. --- diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index ab00724..0b39dd1 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 5dee2c8..ca7f987 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 85281f5..cae4099 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 9312b9a..bf135a2 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