[libcxx-commits] [PATCH] D153140: [libc++][NFC] Apply clang-format on large parts of the code base
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 19 06:26:55 PDT 2023
ldionne added inline comments.
================
Comment at: libcxx/include/__type_traits/invoke.h:355
- using type = __conditional_t<
- _IsNotSame<_Result, __nat>::value,
- __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >,
- false_type>;
+ using type = __conditional_t< _IsNotSame<_Result, __nat>::value,
+ __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >,
----------------
philnik wrote:
> Mordante wrote:
> > ldionne wrote:
> > > Mordante wrote:
> > > > Good old C++03 ;-)
> > > Yeah, that's annoying! Is this a request to change this instance and other ones? I'm not sure it's possible because clang-format will try to enforce that (unfortunate) whitespace.
> > Fixing it will refrain clang-format from touching it. Feel free to ignore it.
> Yeah, this is the `SpacesInAngles: Leave`. It won't remove any whitespace tokens, but also won't add any.
Ah, I understand now. Ok, I fixed it.
================
Comment at: libcxx/include/__type_traits/is_convertible.h:52
+// clang-format off
template <class _Tp,
----------------
philnik wrote:
> In this case I don't get why you didn't just clang-format it. Also for the similar ones below.
It's really helpful to align these definitions:
```
template <class _Tp> struct __is_array_function_or_void<_Tp, true, false, false> { enum { value = 1 }; };
template <class _Tp> struct __is_array_function_or_void<_Tp, false, true, false> { enum { value = 2 }; };
template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true> { enum { value = 3 }; };
```
Otherwise, which specialization handles which combination of `is_array`/`is_function`/`is_void` isn't nearly as clear. A similar reasoning applies in other places.
I've left things as-is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153140/new/
https://reviews.llvm.org/D153140
More information about the libcxx-commits
mailing list