diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -111,6 +111,7 @@ SFINAE. - Clang now supports `requires cplusplus20` for module maps. - Implemented missing parts of `P2002R1: Consistent comparison operators `_ +- Clang now defines `__cpp_consteval` macro. C++23 Feature Support ^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -683,7 +683,7 @@ // 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 --- 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 --- a/clang/www/cxx_status.html +++ b/clang/www/cxx_status.html @@ -643,14 +643,7 @@ Immediate functions (consteval) P1073R3 - -
Clang 15 (Partial) - 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. -
- + Clang 17 P1937R2