Skip to content

Commit 73cfd45

Browse files
authored
[Clang] Set the FTM for trivial relocation (#142936)
The language of side seems fairly stable. Setting the feature test macro will ease implementation in standard libraries.
1 parent 586c0ad commit 73cfd45

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
766766
Builder.defineMacro("__cpp_pack_indexing", "202311L");
767767
Builder.defineMacro("__cpp_deleted_function", "202403L");
768768
Builder.defineMacro("__cpp_variadic_friend", "202403L");
769-
// Builder.defineMacro("__cpp_trivial_relocatability", "202502L");
769+
Builder.defineMacro("__cpp_trivial_relocatability", "202502L");
770770

771771
if (LangOpts.Char8)
772772
Builder.defineMacro("__cpp_char8_t", "202207L");

clang/test/Lexer/cxx-features.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
#error "wrong value for __cpp_placeholder_variables"
5050
#endif
5151

52+
#if check(trivial_relocatability, 202502, 202502, 202502, 202502, 202502, 202502, 202502)
53+
#error "wrong value for __cpp_trivial_relocatability"
54+
#endif
55+
5256
// --- C++23 features ---
5357

5458
#if check(auto_cast, 0, 0, 0, 0, 0, 202110, 202110)

clang/www/cxx_status.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,7 @@ <h2 id="cxx26">C++2c implementation status</h2>
280280
<tr>
281281
<td>Trivial Relocatability</pre></td>
282282
<td><a href="https://wg21.link/P2786">P2786R13</a></td>
283-
<td class="partial" align="center">
284-
<details>
285-
<summary>Clang 21 (Partial)</summary>
286-
The feature test macro (<code>__cpp_trivial_relocatability</code>) has not yet been set.
287-
</details>
288-
</td>
283+
<td class="unreleased" align="center">Clang 21</td>
289284
</tr>
290285
<tr>
291286
<td><pre>#embed</pre></td>

0 commit comments

Comments
 (0)