[libcxx-commits] [libcxx] [libc++] Fix the visibility of type traits (PR #111522)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 8 04:29:26 PDT 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 1df8ccd35b7140b4f1ca9e6d9d2fdf67f93357d4 b92b11f7affcff01131a1a1f4fe2ba23adf0233c --extensions cpp,h -- libcxx/test/std/utilities/meta/meta.rel/visibility.sh.cpp libcxx/test/std/utilities/meta/meta.trans/visibility.sh.cpp libcxx/test/std/utilities/meta/meta.unary.prop.query/visibility.sh.cpp libcxx/test/std/utilities/meta/meta.unary/visibility.sh.cpp libcxx/include/__type_traits/alignment_of.h libcxx/include/__type_traits/extent.h libcxx/include/__type_traits/has_unique_object_representation.h libcxx/include/__type_traits/has_virtual_destructor.h libcxx/include/__type_traits/invoke.h libcxx/include/__type_traits/is_abstract.h libcxx/include/__type_traits/is_aggregate.h libcxx/include/__type_traits/is_arithmetic.h libcxx/include/__type_traits/is_array.h libcxx/include/__type_traits/is_assignable.h libcxx/include/__type_traits/is_base_of.h libcxx/include/__type_traits/is_bounded_array.h libcxx/include/__type_traits/is_class.h libcxx/include/__type_traits/is_compound.h libcxx/include/__type_traits/is_const.h libcxx/include/__type_traits/is_constructible.h libcxx/include/__type_traits/is_convertible.h libcxx/include/__type_traits/is_destructible.h libcxx/include/__type_traits/is_empty.h libcxx/include/__type_traits/is_enum.h libcxx/include/__type_traits/is_final.h libcxx/include/__type_traits/is_floating_point.h libcxx/include/__type_traits/is_function.h libcxx/include/__type_traits/is_fundamental.h libcxx/include/__type_traits/is_integral.h libcxx/include/__type_traits/is_member_pointer.h libcxx/include/__type_traits/is_nothrow_assignable.h libcxx/include/__type_traits/is_nothrow_constructible.h libcxx/include/__type_traits/is_nothrow_convertible.h libcxx/include/__type_traits/is_nothrow_destructible.h libcxx/include/__type_traits/is_null_pointer.h libcxx/include/__type_traits/is_object.h libcxx/include/__type_traits/is_pointer.h libcxx/include/__type_traits/is_polymorphic.h libcxx/include/__type_traits/is_reference.h libcxx/include/__type_traits/is_same.h libcxx/include/__type_traits/is_scalar.h libcxx/include/__type_traits/is_signed.h libcxx/include/__type_traits/is_standard_layout.h libcxx/include/__type_traits/is_swappable.h libcxx/include/__type_traits/is_trivial.h libcxx/include/__type_traits/is_trivially_assignable.h libcxx/include/__type_traits/is_trivially_constructible.h libcxx/include/__type_traits/is_trivially_copyable.h libcxx/include/__type_traits/is_trivially_destructible.h libcxx/include/__type_traits/is_unbounded_array.h libcxx/include/__type_traits/is_union.h libcxx/include/__type_traits/is_unsigned.h libcxx/include/__type_traits/is_void.h libcxx/include/__type_traits/is_volatile.h libcxx/include/__type_traits/rank.h
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__type_traits/has_unique_object_representation.h b/libcxx/include/__type_traits/has_unique_object_representation.h
index ff474f731e..ec7040a8ec 100644
--- a/libcxx/include/__type_traits/has_unique_object_representation.h
+++ b/libcxx/include/__type_traits/has_unique_object_representation.h
@@ -31,7 +31,8 @@ struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
     : public integral_constant<bool, __has_unique_object_representations(remove_all_extents_t<_Tp>)> {};
 
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp);
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool has_unique_object_representations_v =
+    __has_unique_object_representations(_Tp);
 
 #endif
 
diff --git a/libcxx/include/__type_traits/invoke.h b/libcxx/include/__type_traits/invoke.h
index 10725f0f61..5e9cd7504d 100644
--- a/libcxx/include/__type_traits/invoke.h
+++ b/libcxx/include/__type_traits/invoke.h
@@ -255,7 +255,8 @@ template <class _Fn, class... _Args>
 _LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
 
 template <class _Ret, class _Fn, class... _Args>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_invocable_r_v =
+    is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
 
 template <class _Fn, class... _Args>
 struct _LIBCPP_TEMPLATE_VIS invoke_result : __invoke_of<_Fn, _Args...> {};
diff --git a/libcxx/include/__type_traits/is_nothrow_constructible.h b/libcxx/include/__type_traits/is_nothrow_constructible.h
index 762936b9c1..27c4f35111 100644
--- a/libcxx/include/__type_traits/is_nothrow_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_constructible.h
@@ -26,7 +26,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp, class... _Args>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_constructible_v =
+    is_nothrow_constructible<_Tp, _Args...>::value;
 #endif
 
 template <class _Tp>
@@ -35,7 +36,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_copy_constructible_v =
+    is_nothrow_copy_constructible<_Tp>::value;
 #endif
 
 template <class _Tp>
@@ -44,7 +46,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_nothrow_move_constructible_v =
+    is_nothrow_move_constructible<_Tp>::value;
 #endif
 
 template <class _Tp>
diff --git a/libcxx/include/__type_traits/is_trivially_assignable.h b/libcxx/include/__type_traits/is_trivially_assignable.h
index 20e4991dee..d6f9bb0eb4 100644
--- a/libcxx/include/__type_traits/is_trivially_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_assignable.h
@@ -37,7 +37,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_copy_assignable_v =
+    is_trivially_copy_assignable<_Tp>::value;
 #endif
 
 template <class _Tp>
@@ -48,7 +49,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_move_assignable_v =
+    is_trivially_move_assignable<_Tp>::value;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__type_traits/is_trivially_constructible.h b/libcxx/include/__type_traits/is_trivially_constructible.h
index 06f8bee52f..4f0ef24457 100644
--- a/libcxx/include/__type_traits/is_trivially_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_constructible.h
@@ -26,7 +26,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp, class... _Args>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Tp, _Args...);
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_constructible_v =
+    __is_trivially_constructible(_Tp, _Args...);
 #endif
 
 template <class _Tp>
@@ -35,7 +36,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_copy_constructible_v =
+    is_trivially_copy_constructible<_Tp>::value;
 #endif
 
 template <class _Tp>
@@ -44,7 +46,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value;
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_move_constructible_v =
+    is_trivially_move_constructible<_Tp>::value;
 #endif
 
 template <class _Tp>
@@ -53,7 +56,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
 
 #if _LIBCPP_STD_VER >= 17
 template <class _Tp>
-_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Tp);
+_LIBCPP_EXPORTED_FROM_ABI inline constexpr bool is_trivially_default_constructible_v =
+    __is_trivially_constructible(_Tp);
 #endif
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/test/std/utilities/meta/meta.unary/visibility.sh.cpp b/libcxx/test/std/utilities/meta/meta.unary/visibility.sh.cpp
index dabe3a9a9d..a9fae71b5c 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/visibility.sh.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/visibility.sh.cpp
@@ -106,7 +106,7 @@ inline std::vector<void*> get_ptrs() {
 }
 
 inline std::vector<const std::type_info*> get_type_infos() {
-    return {
+  return {
       // [meta.unary.cat]
       &typeid(std::is_void<int>),
       &typeid(std::is_null_pointer<int>),

``````````

</details>


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


More information about the libcxx-commits mailing list