This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4375. std::simd::bit_ceil should not be noexcept

Section: 29.10.8.15 [simd.bit] Status: New Submitter: Matthias Kretz Opened: 2025-08-29 Last modified: 2025-09-19

Priority: Not Prioritized

View all issues with New status.

Discussion:

std::simd::bit_ceil is declared 'noexcept' in 29.10.3 [simd.syn] and 29.10.8.15 [simd.bit]. But

  1. std::bit_ceil is not 'noexcept' (22.11.2 [bit.syn] and 22.11.5 [bit.pow.two]) and

  2. std::simd::bit_ceil has a precondition.

Proposed resolution:

This wording is relative to N5014.

  1. Modify 29.10.3 [simd.syn], header <simd> synopsis, as indicated:

    namespace std {
      […]
      // 29.10.8.15 [simd.bit], bit manipulation
      template<simd-vec-type V> constexpr V byteswap(const V& v) noexcept;
      template<simd-vec-type V> constexpr V bit_ceil(const V& v) noexcept;
      template<simd-vec-type V> constexpr V bit_floor(const V& v) noexcept;  
      […]
    }
    
  2. Modify 29.10.8.15 [simd.bit] as indicated:

    template<simd-vec-type V> constexpr V bit_ceil(const V& v) noexcept;
    

    -3- Constraints: The type V::value_type is an unsigned integer type (6.9.2 [basic.fundamental]).

    -4- Preconditions: […]

    […]