Created on 2025-10-20.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N5014.
Modify [charconv.from.chars] as indicated:
constexpr from_chars_result from_chars(const char* first, const char* last, integer-type& value, int base = 10);-2- Preconditions: `base` has a value between 2 and 36 (inclusive).
-3- Effects: The pattern is the expected form of the subject sequence in the "C" locale for the given nonzero base, as described for `strtol`, except that no `"0b"` or `"0B"` prefix shall appear if the value of `base` is 2, no `"0x"` or `"0X"` prefix shall appear if the value of `base` is 16, and except that `'-'` is the only sign that may appear, and only if `value` has a signed type. -4- Throws: Nothing.
[ Kona 2025-11-08; Status changed: Immediate → WP. ]
[ Kona 2025-11-07; approved by LWG. Status changed: New → Immediate. ]
C23 added support for the `"0b"` and `"0B"` base prefix to `strtol`, and since the wording of `from_chars` for integers is based on `strol`, this inadvertently added support for parsing `"0b"` prefixes to `from_chars`.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-11 10:48:55 | admin | set | messages: + msg15685 |
| 2025-11-11 10:48:55 | admin | set | status: immediate -> wp |
| 2025-11-07 19:46:31 | admin | set | messages: + msg15599 |
| 2025-11-07 19:46:31 | admin | set | status: new -> immediate |
| 2025-10-25 13:26:44 | admin | set | messages: + msg15423 |
| 2025-10-20 00:00:00 | admin | create | |