Skip to content

Commit bba6ea8

Browse files
committed
[C++20] Claim full support for consteval again
After resolving several outstanding issues now is the time to mark it as fully supported. Fixes #57094 Reviewed By: aaron.ballman, cor3ntin, #clang-language-wg Differential Revision: https://reviews.llvm.org/D147717
1 parent d209084 commit bba6ea8

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ C++20 Feature Support
111111
SFINAE.
112112
- Clang now supports `requires cplusplus20` for module maps.
113113
- Implemented missing parts of `P2002R1: Consistent comparison operators <https://wg21.link/P2002R1>`_
114+
- Clang now defines `__cpp_consteval` macro.
114115

115116
C++23 Feature Support
116117
^^^^^^^^^^^^^^^^^^^^^

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
683683
// Refer to the discussion of this at https://reviews.llvm.org/D128619.
684684
Builder.defineMacro("__cpp_concepts", "201907L");
685685
Builder.defineMacro("__cpp_conditional_explicit", "201806L");
686-
// Builder.defineMacro("__cpp_consteval", "202211L");
686+
Builder.defineMacro("__cpp_consteval", "202211L");
687687
Builder.defineMacro("__cpp_constexpr_dynamic_alloc", "201907L");
688688
Builder.defineMacro("__cpp_constinit", "201907L");
689689
Builder.defineMacro("__cpp_impl_coroutine", "201902L");

clang/test/Lexer/cxx-features.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
#error "wrong value for __cpp_conditional_explicit"
7979
#endif
8080

81-
#if check(consteval, 0, 0, 0, 0, 0, 0)
82-
// FIXME: 201811 in C++20
81+
#if check(consteval, 0, 0, 0, 0, 202211, 202211)
8382
#error "wrong value for __cpp_consteval"
8483
#endif
8584

clang/www/cxx_status.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,14 +643,7 @@ <h2 id="cxx20">C++20 implementation status</h2>
643643
<tr>
644644
<td rowspan=2>Immediate functions (<tt>consteval</tt>)</td>
645645
<td><a href="https://wg21.link/p1073r3">P1073R3</a></td>
646-
<td class="partial" align="center">
647-
<details><summary>Clang 15 (Partial)</summary>
648-
Clang still incorrectly defers some consteval executions to runtime,
649-
resulting in CodeGen crashes. Additionally, Clang does not properly
650-
handle default arguments in consteval functions under all
651-
circumstances.
652-
</details>
653-
</td>
646+
<td class="full" align="center">Clang 17</td>
654647
</tr>
655648
<tr> <!-- from Prague -->
656649
<td><a href="https://wg21.link/p1937r2">P1937R2</a></td>

0 commit comments

Comments
 (0)