Skip to content
Snippets Groups Projects
Commit 1c153033 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

libstdc++: Fix <charconv> uses of signed types with <bit> functions

In <charconv> we pass the int __base parameter to our internal versions
of <bit> functions, __bit_width and __countr_zero. Those functions are
only defined for unsigned types, so we need to convert the base to
unsigned. The base must be in the range [2,36] so we can mask off the
low bits and then convert that to unsigned, so that we don't need to
care about negative values becoming large unsigned values.

libstdc++-v3/ChangeLog:

	* include/std/charconv (__from_chars_pow2_base): Convert base to
	unsigned for call to __countr_zero.
	(__from_chars_alnum): Likewise for call to __bit_width.
parent 6f2fc42d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment