Skip to content

Commit

Permalink
Ensure that stim compiles with clang -Wctad-maybe-unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
folded committed Apr 8, 2024
1 parent 8f8988a commit ba0bac1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/stim/mem/simd_bits.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ TEST_EACH_WORD_SIZE_W(simd_bits, fuzz_add_assignment, {
// a + b == b + a
std::uniform_real_distribution<double> dist_real(0, 1);
for (int i = 0; i < 10; i++) {
std::uniform_int_distribution dist_bits(1, 1200);
std::uniform_int_distribution<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> m1(num_bits), m2(num_bits);
set_random_words_to_all_set(m1, num_bits, rng, dist_real);
Expand All @@ -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<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> m1(num_bits);
simd_bits<W> zero(num_bits);
Expand All @@ -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<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> m1(num_bits);
m1.randomize(num_bits, rng);
Expand All @@ -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<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> alhs(num_bits);
simd_bits<W> blhs(num_bits);
Expand Down Expand Up @@ -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<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> 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<size_t> 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++) {
Expand Down Expand Up @@ -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<int> dist_bits(1, 1200);
int num_bits = dist_bits(rng);
simd_bits<W> 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<size_t> 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++) {
Expand Down
2 changes: 1 addition & 1 deletion src/stim/stabilizers/pauli_string_iter.pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void stim_pybind::pybind_pauli_string_iter_methods(
c.def(
"__iter__",
[](PauliStringIterator<MAX_BITWORD_WIDTH> &self) -> PauliStringIterator<MAX_BITWORD_WIDTH> {
PauliStringIterator copy = self;
PauliStringIterator<MAX_BITWORD_WIDTH> copy = self;
return copy;
},
clean_doc_string(R"DOC(
Expand Down

0 comments on commit ba0bac1

Please sign in to comment.