Use unsigned literals where the element type is unsigned
A bare {1, 2, 3, 4, 5} deduces initializer_list<int>, and the
sign-changing conversion to each std::uint64_t element trips Clang's
-Wconversion under -Werror, failing the Linux analysis build.
MSVC /W4 /WX does not diagnose this, and GCC's -Wconversion does not warn
when a constant value is known to fit, so the local checks and the GCC
Release job both passed. Only Clang caught it.
Reproducing Clang's diagnostic locally was not possible: clang-tidy does
not honour the warning flags in its cl driver mode and no clang driver is
installed on this host. The tree was audited by hand for the pattern
instead. Every other range-for over a braced literal list either deduces
through auto or already carries suffixes matching its declared type, so
this was the only instance. That audit catches this one, not the next
one, and the standing gap is recorded in the validation report: no Clang
or GCC compile happens here before a push.
Native Release, clang-tidy analysis and format checks pass 21/21.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -151,7 +151,9 @@ void death_is_terminal_and_births_are_unique() {
|
||||
void absence_is_never_reported_as_extinction() {
|
||||
auto archive = branching();
|
||||
// Nothing was ever born: every lineage is absent, and none is extinct.
|
||||
for (const std::uint64_t genome : {1, 2, 3, 4, 5}) {
|
||||
// Unsigned literals: a bare list deduces initializer_list<int>, and the
|
||||
// sign-changing conversion to each element fails Clang's -Wconversion.
|
||||
for (const std::uint64_t genome : {1U, 2U, 3U, 4U, 5U}) {
|
||||
CHECK(*archive.status(genome) == LineageStatus::absent);
|
||||
CHECK(*archive.living_carriers(genome) == 0);
|
||||
CHECK(archive.find(genome)); // Still retained regardless.
|
||||
|
||||
Reference in New Issue
Block a user