[libcxx-commits] [libcxx] [libcxx][c++26] 2937R0: Freestanding: Remove strtok (PR #146290)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 29 19:58:56 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions ,cpp -- libcxx/test/std/cstring/freestanding/strtok_removed.fail.cpp libcxx/include/cstring libcxx/include/version
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/cstring b/libcxx/include/cstring
index 3828b33c9..efa8653d3 100644
--- a/libcxx/include/cstring
+++ b/libcxx/include/cstring
@@ -97,9 +97,9 @@ using ::strpbrk _LIBCPP_USING_IF_EXISTS;
 using ::strrchr _LIBCPP_USING_IF_EXISTS;
 using ::strspn _LIBCPP_USING_IF_EXISTS;
 using ::strstr _LIBCPP_USING_IF_EXISTS;
-#if __STDC_HOSTED__ == 1 || _LIBCPP_STD_VER < 26
+#  if __STDC_HOSTED__ == 1 || _LIBCPP_STD_VER < 26
 using ::strtok _LIBCPP_USING_IF_EXISTS;
-#endif
+#  endif
 using ::memset _LIBCPP_USING_IF_EXISTS;
 using ::strerror _LIBCPP_USING_IF_EXISTS;
 using ::strlen _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/include/version b/libcxx/include/version
index 591844beb..400ab6573 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -116,8 +116,8 @@ __cpp_lib_formatters                                    202302L <stacktrace> <th
 __cpp_lib_forward_like                                  202207L <utility>
 __cpp_lib_freestanding_algorithm                        202311L <algorithm>
 __cpp_lib_freestanding_array                            202311L <array>
-__cpp_lib_freestanding_cstring                          202306L <cstring> 
-                                                        202306L 
+__cpp_lib_freestanding_cstring                          202306L <cstring>
+                                                        202306L
 __cpp_lib_freestanding_expected                         202311L <expected>
 __cpp_lib_freestanding_mdspan                           202311L <mdspan>
 __cpp_lib_freestanding_optional                         202311L <optional>
diff --git a/libcxx/test/std/cstring/freestanding/strtok_removed.fail.cpp b/libcxx/test/std/cstring/freestanding/strtok_removed.fail.cpp
index 0f0869380..030249add 100644
--- a/libcxx/test/std/cstring/freestanding/strtok_removed.fail.cpp
+++ b/libcxx/test/std/cstring/freestanding/strtok_removed.fail.cpp
@@ -4,10 +4,10 @@
 
 // RUN: %clang %s -c -o /dev/null -ffreestanding --std=c++2c 2>&1 | FileCheck %s
 
-#include <cstring> 
+#include <cstring>
 
 int main() {
-  char s[] = "hello world";
+  char s[]  = "hello world";
   char* tok = std::strtok(s, " ");
   (void)tok;
   return 0;

``````````

</details>


https://github.com/llvm/llvm-project/pull/146290


More information about the libcxx-commits mailing list