Author: Mariya Podchishchaeva Date: 2023-06-13T03:50:24-04:00 New Revision: bba6ea8c2d56faad49936b95a57c7499095b920b
URL: https://github.com/llvm/llvm-project/commit/bba6ea8c2d56faad49936b95a57c7499095b920b DIFF: https://github.com/llvm/llvm-project/commit/bba6ea8c2d56faad49936b95a57c7499095b920b.diff LOG: [C++20] Claim full support for consteval again After resolving several outstanding issues now is the time to mark it as fully supported. Fixes https://github.com/llvm/llvm-project/issues/57094 Reviewed By: aaron.ballman, cor3ntin, #clang-language-wg Differential Revision: https://reviews.llvm.org/D147717 Added: Modified: clang/docs/ReleaseNotes.rst clang/lib/Frontend/InitPreprocessor.cpp clang/test/Lexer/cxx-features.cpp clang/www/cxx_status.html Removed: ################################################################################ diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 32f41382a35cb..a6b4a79b00a19 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -111,6 +111,7 @@ C++20 Feature Support SFINAE. - Clang now supports `requires cplusplus20` for module maps. - Implemented missing parts of `P2002R1: Consistent comparison operators <https://wg21.link/P2002R1>`_ +- Clang now defines `__cpp_consteval` macro. C++23 Feature Support ^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 2d5be2b6242b8..31f9077703cba 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -683,7 +683,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, // Refer to the discussion of this at https://reviews.llvm.org/D128619. Builder.defineMacro("__cpp_concepts", "201907L"); Builder.defineMacro("__cpp_conditional_explicit", "201806L"); - // Builder.defineMacro("__cpp_consteval", "202211L"); + Builder.defineMacro("__cpp_consteval", "202211L"); Builder.defineMacro("__cpp_constexpr_dynamic_alloc", "201907L"); Builder.defineMacro("__cpp_constinit", "201907L"); Builder.defineMacro("__cpp_impl_coroutine", "201902L"); diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp index 5d157ea2fac1c..6d4cb25044c62 100644 --- a/clang/test/Lexer/cxx-features.cpp +++ b/clang/test/Lexer/cxx-features.cpp @@ -78,8 +78,7 @@ #error "wrong value for __cpp_conditional_explicit" #endif -#if check(consteval, 0, 0, 0, 0, 0, 0) -// FIXME: 201811 in C++20 +#if check(consteval, 0, 0, 0, 0, 202211, 202211) #error "wrong value for __cpp_consteval" #endif diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html index 9bcb02d520873..d2ef73f821ceb 100755 --- a/clang/www/cxx_status.html +++ b/clang/www/cxx_status.html @@ -643,14 +643,7 @@ <h2 id="cxx20">C++20 implementation status</h2> <tr> <td rowspan=2>Immediate functions (<tt>consteval</tt>)</td> <td><a href="https://wg21.link/p1073r3">P1073R3</a></td> - <td class="partial" align="center"> - <details><summary>Clang 15 (Partial)</summary> - Clang still incorrectly defers some consteval executions to runtime, - resulting in CodeGen crashes. Additionally, Clang does not properly - handle default arguments in consteval functions under all - circumstances. - </details> - </td> + <td class="full" align="center">Clang 17</td> </tr> <tr> <!-- from Prague --> <td><a href="https://wg21.link/p1937r2">P1937R2</a></td> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits