<span class="bold"><strong><code class="code">path::lexically_relative</code> is confused by trailing slashes
</strong></span>
</span></dt><dd><p>Implement the fix for trailing slashes.
+ </p></dd><dt><a id="manual.bugs.dr3656"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#3656" target="_top">3656</a>:
+ <span class="bold"><strong>Inconsistent bit operations returning a count
+ </strong></span>
+ </span></dt><dd><p>Changed <code class="code">bit_width</code> to return <code class="code">int</code>.
</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>
\ No newline at end of file
<listitem><para>Implement the fix for trailing slashes.
</para></listitem></varlistentry>
+ <varlistentry xml:id="manual.bugs.dr3656"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#3656">3656</link>:
+ <emphasis role="bold">Inconsistent bit operations returning a count
+ </emphasis>
+ </term>
+ <listitem><para>Changed <code>bit_width</code> to return <code>int</code>.
+ </para></listitem></varlistentry>
+
</variablelist>
</section>
}
template<typename _Tp>
- constexpr _Tp
+ constexpr int
__bit_width(_Tp __x) noexcept
{
constexpr auto _Nd = __gnu_cxx::__int_traits<_Tp>::__digits;
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); }
--- /dev/null
+// { dg-options "-std=gnu++20" }
+// { dg-do compile { target c++20 } }
+
+#include <bit>
+
+template<typename T> constexpr bool is_int = false;
+template<> constexpr bool is_int<int> = true;
+
+// LWG 3656. Inconsistent bit operations returning a count
+// Rturn type of std::bit_width(T) changed from T to int.
+static_assert( is_int<decltype(std::bit_width(1u))> );
+static_assert( is_int<decltype(std::bit_width(1ul))> );
+static_assert( is_int<decltype(std::bit_width(1ull))> );
+static_assert( is_int<decltype(std::bit_width((unsigned short)1))> );
+static_assert( is_int<decltype(std::bit_width((unsigned char)1))> );