[libc-commits] [libc] [llvm] [libc] Remove UB specializations of type traits for `BigInt` (PR #84035)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Wed Mar 6 00:37:59 PST 2024


================
@@ -208,8 +221,8 @@ template <typename T, typename Fmt = radix::Dec> class IntegerToString {
 
   // An internal stateless structure that handles the number formatting logic.
   struct IntegerWriter {
-    static_assert(cpp::is_integral_v<T>);
-    using UNSIGNED_T = cpp::make_unsigned_t<T>;
+    static_assert(cpp::is_integral_v<T> || cpp::is_big_int_v<T>);
+    using UNSIGNED_T = typename details::IntegerWriterUnsigned<T>::type;
----------------
gchatelet wrote:

_Inside a declaration or a definition of a template, typename can be used to declare that a [dependent qualified name](https://en.cppreference.com/w/cpp/language/dependent_name) is a type._ [source](https://en.cppreference.com/w/cpp/keyword/typename#:~:text=Inside%20a%20declaration,is%20a%20type.)

This is because `UNSIGNED_T` depends on `T`.

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


More information about the libc-commits mailing list