Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoGarcia committed Feb 27, 2025
1 parent a4285d5 commit 82f9c22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions icecream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,6 @@ namespace icecream{ namespace detail
, count_{static_cast<size_t>(last - first)}
{}

BasicStringView& operator=(BasicStringView const& other) = default;

auto empty() const -> bool
{
return this->count_ == 0;
Expand Down
14 changes: 7 additions & 7 deletions tests/test_c++20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST_CASE("ranges view")

auto arr = std::vector<std::pair<double, int>>{{0.1, 10}, {1.1, 11}};
auto v0 = arr | rv::transform([](auto i){return i.second;}) | IC_V();
for (auto i : v0){}
for (auto i : v0){(void)i;}
#if defined(ICECREAM_SOURCE_LOCATION) && defined(__clang__)
REQUIRE(str == "ic| range_view_40:76[0]: 10\nic| range_view_40:76[1]: 11\n");
#elif defined(ICECREAM_SOURCE_LOCATION)
Expand All @@ -55,7 +55,7 @@ TEST_CASE("ranges view")

auto arr = std::vector<std::pair<double, int>>{{0.1, 10}, {1.1, 11}, {2.1, 12}};
auto v0 = arr | rv::drop(2) | IC_V([](auto i){return i.second;});
for (auto i : v0){}
for (auto i : v0){(void)i;}
#if defined(ICECREAM_SOURCE_LOCATION) && defined(__clang__)
REQUIRE(str == "ic| range_view_57:72[0]: 12\n");
#elif defined(ICECREAM_SOURCE_LOCATION)
Expand All @@ -72,7 +72,7 @@ TEST_CASE("ranges view")

auto arr = std::vector<std::pair<double, int>>{{0.1, 10}, {1.1, 11}};
auto v0 = arr | IC_FV(":#x", [](auto i){return i.second;}) | rv::drop(0); //68
for (auto i : v0){}
for (auto i : v0){(void)i;}
#if defined(ICECREAM_SOURCE_LOCATION) && defined(__clang__)
auto const result =
"ic| range_view_74:66[0]: 0xa\n"
Expand Down Expand Up @@ -188,7 +188,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<invalid slice formatting string>\"\n");
}

Expand All @@ -199,7 +199,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[::-1]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<slice steps must be strictly positive>\"\n");
}

Expand All @@ -210,7 +210,7 @@ TEST_CASE("ranges view erros")

auto arr = std::forward_list<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[:-1:]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<this range view supports only non-negative slice indexes>\"\n");
}

Expand All @@ -221,7 +221,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = rv::drop(2) | IC_FV("[:-1:]", "v");
for (auto i : arr | v0){}
for (auto i : arr | v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<partial views supports only non-negative slice indexes>\"\n");
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/test_range_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST_CASE("ranges view")
using Pair = std::pair<double, int>;
auto arr = std::vector<Pair>{{0.1, 10}, {1.1, 11}};
auto v0 = arr | rv::transform([](Pair const& i){return i.second;}) | IC_V();
for (auto i : v0){}
for (auto i : v0){(void)i;}
#if defined(ICECREAM_SOURCE_LOCATION) && defined(__clang__)
auto const result =
"ic| range_view_27:83[0]: 10\n"
Expand Down Expand Up @@ -191,7 +191,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<invalid slice formatting string>\"\n");
}

Expand All @@ -202,7 +202,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[::-1]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<slice steps must be strictly positive>\"\n");
}

Expand All @@ -213,7 +213,7 @@ TEST_CASE("ranges view erros")

auto arr = std::forward_list<int>{1, 2, 3};
auto v0 = arr | rv::drop(2) | IC_FV("[:-1:]", "v");
for (auto i : v0){}
for (auto i : v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<this range view supports only non-negative slice indexes>\"\n");
}

Expand All @@ -224,7 +224,7 @@ TEST_CASE("ranges view erros")

auto arr = std::vector<int>{1, 2, 3};
auto v0 = rv::drop(2) | IC_FV("[:-1:]", "v");
for (auto i : arr | v0){}
for (auto i : arr | v0){(void)i;}
REQUIRE(str == "ic| v[0]: \"<partial views supports only non-negative slice indexes>\"\n");
}
}

0 comments on commit 82f9c22

Please sign in to comment.