P3666R3 — Bit-precise integers
(14 items)
EWG, LEWG
This paper proposes adding C23's bit-precise integer types (_BitInt) to C++ as fundamental types, along with the wb/WB literal suffixes and std::bit_int/std::bit_uint alias templates. The design prioritizes C compatibility by matching C23 semantics including conversion rank rules, integer promotion exemption, and permissive implicit conversions. The proposal includes both core language wording and standard library support covering to_chars, from_chars, to_string, abs, make_signed/make_unsigned, and various other facilities.
-
§9.2.2 [cstdlib.syn] — Editorial instruction says "In [cmath.syn]" but the section is [cstdlib.syn] and the declarations (labs, llabs) belong to
, not . [1] [1] - §9.2.14 [charconv.syn] vs §9.2.16 [charconv.from.chars] — from_chars template synopsis uses char* for the first two parameters; the detailed specification and existing non-template overloads use const char*. Signature mismatch. [2]
- §6.1, Teaching principles — States std::bit_int cannot be used as the underlying type of enumerations, but §4.3 and the [dcl.enum] wording changes only prohibit implementations from implicitly choosing a bit-precise underlying type; explicit use (enum E : _BitInt(32)) is permitted. Teaching section contradicts the paper's own design. [2] [3]
- §8.2, Impact on the standard library, table row for — Type trait spelled "is_integral_type"; the actual trait is is_integral. The paper itself uses is_integral and is_integral_v elsewhere. [3] [4]
- §2.3, between SG22/EWG poll results and contentious-issue blocks — Macro named BITINT_WIDTH; every other occurrence in the paper (§4.4, §4.8, [climits.syn] wording) uses BITINT_MAXWIDTH. [5]
- §3.4, code sample for ~x >> 1 — Binary literal in the comment has 9 digits (0b1'0000'0111); a uint8_t result can have at most 8. Correct value is 0b1000'0111. [6]
- §4.1.8, paragraph about compiler frontend warnings — The word "pre" appears truncated or corrupted; likely intended as "preconditions" or "[[pre]]". [7]
- §5.7, second paragraph — Missing verb (likely "support" or "accept") and "integers types" should be "integer types". [8]
- §5.17, second paragraph — Comma splice: "This has never been a practical issue before, it is now theoretically possible" — missing conjunction (e.g., "but"). [9]
- §9.1.7 [dcl.enum], wording for paragraph 5 — "prior ot" — transposed letters; should be "prior to". [10]
- §4.1.8, third-to-last paragraph — "Last but no least" — missing "t"; should be "not". [11]
- §3.1, second paragraph — "requires the user of 128-bit arithmetic" — "user" should be "use". [12]
- §1.3, Changes since R0, final bullet — Doubled word: "more more clearly" — delete one. [13]
References — Anthropic Citations API
[1]
"std::uint8_t y = ~x >> 1; // y = 0b1000'01111"
"std::uint8_t y = ~x >> 1; // y = 0b1000'01111"
[2]
"such as the minimum supported BITINT_WIDTH"
"such as the minimum supported BITINT_WIDTH"
[3]
"to more more clearly distinguish them from wording changes"
"to more more clearly distinguish them from wording changes"
[4]
"requires the user of 128-bit arithmetic"
"requires the user of 128-bit arithmetic"
[5]
"Last but no least,"
"Last but no least,"
[6]
"the type of each enumerator prior ot the closing brace"
"the type of each enumerator prior ot the closing brace"
[7]
"Use of pre on e.g. bit_int::operator/ cannot be used to achieve this"
"Use of pre on e.g. bit_int::operator/ cannot be used to achieve this"
[8]
"C's functions deliberately all integers types"
"C's
[9]
chars 101089–101993
"In [cmath.syn], change the synopsis as follows: constexpr int abs(int j); // freestanding constexpr long int abs(long int j); // freestanding constexpr long long int abs(long long int j); //..."
"In [cmath.syn], change the synopsis as follows: constexpr int abs(int j); // freestanding constexpr long int abs(long int j); // freestanding constexpr long long int abs(long long int j); //..."
[10]
"template constexpr from_chars_result from_chars(char* first, char* last, // freestanding T& value, int base = 10);"
"template
[11]
chars 74717–74791
"std::bit_int cannot be used as the underlying type of enumerations. "
"std::bit_int cannot be used as the underlying type of enumerations. "
[12]
chars 78708–78727
"is_integral_type). "
"is_integral_type). "
[13]
"This has never been a practical issue before, it is now theoretically possible that an implementation may want to provide _BitInt(32'768) or wider."
"This has never been a practical issue before, it is now theoretically possible that an implementation may want to provide _BitInt(32'768) or wider."
Summary: P3666R3 proposes adding bit-precise integer types to C++ via a std::bit_int wrapper over _BitInt(N), with conversions, arithmetic semantics, and standard library integration. Thirteen findings were identified, including a cross-reference pointing to the wrong synopsis section, a function signature mismatch between synopsis and definition, a teaching section that contradicts the paper's own design, and several typos and corrupted words in the prose and wording.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.