diff --git a/include/libcommute/expression/dyn_indices.hpp b/include/libcommute/expression/dyn_indices.hpp index 1e2d65c..a418e2a 100644 --- a/include/libcommute/expression/dyn_indices.hpp +++ b/include/libcommute/expression/dyn_indices.hpp @@ -98,6 +98,7 @@ template class dyn_indices_generic { } // Reference to underlying sequence + // cppcheck-suppress returnByReference explicit operator indices_t const&() const { return indices_; } // Stream output diff --git a/include/libcommute/utility.hpp b/include/libcommute/utility.hpp index 9ce428e..3caabc5 100644 --- a/include/libcommute/utility.hpp +++ b/include/libcommute/utility.hpp @@ -131,9 +131,11 @@ template <> struct print_tuple_impl<0> { } // namespace detail template +// cppcheck-suppress constParameterReference inline void print_tuple(std::ostream& os, std::tuple const& t) { detail::print_tuple_impl::apply(os, t); } +// cppcheck-suppress constParameterReference inline void print_tuple(std::ostream& os, std::tuple<> const& t) {} // diff --git a/test/monomial_action.cpp b/test/monomial_action.cpp index 30bfb4a..ee91940 100644 --- a/test/monomial_action.cpp +++ b/test/monomial_action.cpp @@ -170,8 +170,8 @@ TEST_CASE("Action of a mixed monomial", "[monomial_action]") { static std::vector bit_ranges = {{2, 3}, {4, 5}}; auto const& bit_range = bit_ranges[ind]; - int n_bits = bit_range.second - bit_range.first + 1; - int n_max = (1 << n_bits) - 1; + int const n_bits = bit_range.second - bit_range.first + 1; + int const n_max = (1 << n_bits) - 1; std::bitset in_bitset(index); diff --git a/test/monomial_action_boson.cpp b/test/monomial_action_boson.cpp index a245036..aa087a3 100644 --- a/test/monomial_action_boson.cpp +++ b/test/monomial_action_boson.cpp @@ -66,8 +66,8 @@ TEST_CASE("Action of a bosonic monomial on an index", bool dagger = dynamic_cast const&>(g).dagger(); auto const& bit_range = bit_ranges[ind]; - int n_bits = bit_range.second - bit_range.first + 1; - int n_max = (1 << n_bits) - 1; + int const n_bits = bit_range.second - bit_range.first + 1; + int const n_max = (1 << n_bits) - 1; std::bitset in_bitset(index);