]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/std/bit
libstdc++: Change return type of std::bit_width to int (LWG 3656)
[thirdparty/gcc.git] / libstdc++-v3 / include / std / bit
index 2fd80187210a5f11aaaef7f666b270f697af8f07..3e072ef21133a3925bd96c474c2ef25878f704f2 100644 (file)
@@ -361,7 +361,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    constexpr _Tp
+    constexpr int
     __bit_width(_Tp __x) noexcept
     {
       constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits;
@@ -448,9 +448,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     bit_floor(_Tp __x) noexcept
     { return std::__bit_floor(__x); }
 
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 3656. Inconsistent bit operations returning a count
   /// The smallest integer greater than the base-2 logarithm of `x`.
   template<typename _Tp>
-    constexpr _If_is_unsigned_integer<_Tp>
+    constexpr _If_is_unsigned_integer<_Tp, int>
     bit_width(_Tp __x) noexcept
     { return std::__bit_width(__x); }