From ba0bac1809ac991b1d24ac5d94e31cbd7af949bc Mon Sep 17 00:00:00 2001 From: Toby Sargeant Date: Mon, 8 Apr 2024 13:45:08 +0100 Subject: [PATCH] Ensure that stim compiles with clang -Wctad-maybe-unsupported --- src/stim/mem/simd_bits.test.cc | 16 ++++++++-------- src/stim/stabilizers/pauli_string_iter.pybind.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/stim/mem/simd_bits.test.cc b/src/stim/mem/simd_bits.test.cc index 3421bc770..32a08b014 100644 --- a/src/stim/mem/simd_bits.test.cc +++ b/src/stim/mem/simd_bits.test.cc @@ -319,7 +319,7 @@ TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_add_assignment, { // a + b == b + a std::uniform_real_distribution dist_real(0, 1); for (int i = 0; i < 10; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits m1(num_bits), m2(num_bits); set_random_words_to_all_set(m1, num_bits, rng, dist_real); @@ -331,7 +331,7 @@ TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_add_assignment, { } // (a + 1) + ~a = allset for (int i = 0; i < 10; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits m1(num_bits); simd_bits zero(num_bits); @@ -346,7 +346,7 @@ TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_add_assignment, { } // m1 += x; m1 = ~m1; m1 += x; m1 is unchanged. for (int i = 0; i < 10; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits m1(num_bits); m1.randomize(num_bits, rng); @@ -361,7 +361,7 @@ TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_add_assignment, { } // a + (b + c) == (a + b) + c for (int i = 0; i < 10; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits alhs(num_bits); simd_bits blhs(num_bits); @@ -441,12 +441,12 @@ TEST_EACH_WORD_SIZE_W(simd_bits, right_shift_assignment, { TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_right_shift_assignment, { auto rng = INDEPENDENT_TEST_RNG(); for (int i = 0; i < 5; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits m1(num_bits), m2(num_bits); m1.randomize(num_bits, rng); m2 = m1; - std::uniform_int_distribution dist_shift(0, (int)m1.num_bits_padded()); + std::uniform_int_distribution dist_shift(0, (int)m1.num_bits_padded()); size_t shift = dist_shift(rng); m1 >>= shift; for (size_t k = 0; k < m1.num_bits_padded() - shift; k++) { @@ -491,12 +491,12 @@ TEST_EACH_WORD_SIZE_W(simd_bits, left_shift_assignment, { TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_left_shift_assignment, { auto rng = INDEPENDENT_TEST_RNG(); for (int i = 0; i < 5; i++) { - std::uniform_int_distribution dist_bits(1, 1200); + std::uniform_int_distribution dist_bits(1, 1200); int num_bits = dist_bits(rng); simd_bits m1(num_bits), m2(num_bits); m1.randomize(num_bits, rng); m2 = m1; - std::uniform_int_distribution dist_shift(0, (int)m1.num_bits_padded()); + std::uniform_int_distribution dist_shift(0, (int)m1.num_bits_padded()); size_t shift = dist_shift(rng); m1 <<= shift; for (size_t k = 0; k < m1.num_bits_padded() - shift; k++) { diff --git a/src/stim/stabilizers/pauli_string_iter.pybind.cc b/src/stim/stabilizers/pauli_string_iter.pybind.cc index ecab5a435..221b90f1b 100644 --- a/src/stim/stabilizers/pauli_string_iter.pybind.cc +++ b/src/stim/stabilizers/pauli_string_iter.pybind.cc @@ -51,7 +51,7 @@ void stim_pybind::pybind_pauli_string_iter_methods( c.def( "__iter__", [](PauliStringIterator &self) -> PauliStringIterator { - PauliStringIterator copy = self; + PauliStringIterator copy = self; return copy; }, clean_doc_string(R"DOC(