https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125656

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #9 from Drea Pinski <pinskia at gcc dot gnu.org> ---
The warning is correct.

(PLF_TYPE_BITWIDTH - (PLF_ARRAY_CAPACITY_BITS - total_size))
Will have values of 1..PLF_TYPE_BITWIDTH.

So when you have a multiple of 64, the value would be 64 which in this case
invokes the warning.

You already have the correct thing here:
```
 constexpr void set_overflow_to_zero() noexcept
 {

   if constexpr (total_size % (sizeof(storage_type) * 8) != 0)

  {
   buffer[((total_size + (sizeof(storage_type) * 8) - 1) /
(sizeof(storage_type) * 8)) - 1] &= std::numeric_limits<storage_type>::max() >>
((((total_size + (sizeof(storage_type) * 8) - 1) / (sizeof(storage_type) * 8))
* (sizeof(storage_type) * 8)) - total_size);
  }
}
```

Looks like you missed set_overflow_to_one too

Reply via email to