[libc-commits] [PATCH] D79256: [libc] Improve information printed on failure of a math test which uses MPFR.
Alex Brachet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon May 4 23:07:56 PDT 2020
abrachet accepted this revision.
abrachet added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: libc/utils/CPP/TypeTraits.h:57
+
+template <typename T> using RemoveCVType = typename RemoveCV<T>::Type;
+
----------------
sivachandra wrote:
> abrachet wrote:
> > I believe that `typename` shouldn't be required and `RemoveCV<T>::Type` should be enough.
> `RemoveCV<T>::Type` is a dependent type and should require `typename`? I tried your suggestion and that is what the compiler also tells me:
>
> ```
> TypeTraits.h:57:44: error: missing 'typename' prior to dependent type name 'RemoveCV<T>::Type'
> ```
My mistake, I thought it wasn't necessary because the right hand side of a using can only be a type.
================
Comment at: libc/utils/MPFRWrapper/MPFRUtils.cpp:43-44
+
+ template <typename XType,
+ cpp::EnableIfType<cpp::IsFloatingPointType<XType>::Value, int> = 0>
+ MPFRNumber(Operation op, XType rawValue) {
----------------
sivachandra wrote:
> abrachet wrote:
> > Could this also be just a static_assert?
> Again, are you suggesting to put a `static_assert` inside the function body? If yes, it feels a bit odd to error-out with a custom message rather than give a normal compiler message for a constructor.
Sounds good to keep it like this then
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79256/new/
https://reviews.llvm.org/D79256
More information about the libc-commits
mailing list