[libcxx-commits] [libcxx] [libc++][Android] Restrict use of mblen/towctrans/wctrans (PR #116147)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 13 18:38:09 PST 2024
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 49f90e798fe5667ac5e71a796aa897af3185137d b66919bc3356be017394cfd50bd06b776166b66a --extensions cpp -- libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp libcxx/test/std/depr/depr.c.headers/wctype_h.compile.pass.cpp libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp libcxx/test/std/strings/c.strings/cwctype.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
index 8199fabe3d..82083734c7 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -142,9 +142,9 @@ int main(int, char**) {
const wchar_t* pwc = 0;
char* pc = 0;
// mblen was added in Android API 26.
-#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
+# if !defined(__ANDROID__) || __ANDROID_API__ >= 26
ASSERT_SAME_TYPE(int, decltype(mblen("",0)));
-#endif
+# endif
ASSERT_SAME_TYPE(int, decltype(mbtowc(pw,"",0)));
ASSERT_SAME_TYPE(int, decltype(wctomb(pc,L' ')));
ASSERT_SAME_TYPE(size_t, decltype(mbstowcs(pw,"",0)));
diff --git a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
index 5f33c72f85..a00bf13936 100644
--- a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -142,9 +142,9 @@ int main(int, char**)
const wchar_t* pwc = 0;
char* pc = 0;
// mblen was added in Android API 26.
-#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
+# if !defined(__ANDROID__) || __ANDROID_API__ >= 26
static_assert((std::is_same<decltype(std::mblen("",0)), int>::value), "");
-#endif
+# endif
static_assert((std::is_same<decltype(std::mbtowc(pw,"",0)), int>::value), "");
static_assert((std::is_same<decltype(std::wctomb(pc,L' ')), int>::value), "");
static_assert((std::is_same<decltype(std::mbstowcs(pw,"",0)), std::size_t>::value), "");
``````````
</details>
https://github.com/llvm/llvm-project/pull/116147
More information about the libcxx-commits
mailing list