[libcxx-commits] [PATCH] D153289: [libc++] Make sure our .clang-format is used for all languages
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 19 08:22:37 PDT 2023
ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
In particular, this ensures that it is used for Objective-C and
Objective-C++, since we have a few files that get detected as that.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D153289
Files:
libcxx/.clang-format
libcxx/include/__type_traits/is_scalar.h
Index: libcxx/include/__type_traits/is_scalar.h
===================================================================
--- libcxx/include/__type_traits/is_scalar.h
+++ libcxx/include/__type_traits/is_scalar.h
@@ -18,7 +18,7 @@
#include <__type_traits/is_pointer.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
+# pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -28,17 +28,19 @@
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp> inline constexpr bool is_scalar_v = __is_scalar(_Tp);
-#endif
+# if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_scalar_v = __is_scalar(_Tp);
+# endif
#else // __has_builtin(__is_scalar)
-template <class _Tp> struct __is_block : false_type {};
-#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
+template <class _Tp>
+struct __is_block : false_type {};
+# if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
template <class _Rp, class... _Args>
struct __is_block<_Rp (^)(_Args...)> : true_type {};
-#endif
+# endif
// clang-format off
template <class _Tp>
@@ -55,9 +57,10 @@
template <>
struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
-#if _LIBCPP_STD_VER >= 17
-template <class _Tp> inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
-#endif
+# if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
+# endif
#endif // __has_builtin(__is_scalar)
Index: libcxx/.clang-format
===================================================================
--- libcxx/.clang-format
+++ libcxx/.clang-format
@@ -66,7 +66,6 @@
PenaltyIndentedWhitespace: 2
-Language: Cpp
Standard: c++20
SpacesInAngles: Leave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153289.532673.patch
Type: text/x-patch
Size: 1799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230619/97068bcb/attachment.bin>
More information about the libcxx-commits
mailing list