Skip to content

Commit 92dc268

Browse files
committed
trying to play well with werror
1 parent 0ed5301 commit 92dc268

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/beman/inplace_vector/ref_impl.test.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#pragma GCC diagnostic ignored "-Wsign-compare"
2+
13
/// \file
24
///
35
/// Test for inline_vector
@@ -211,9 +213,11 @@ template <typename T, std::size_t N> constexpr void test_il_assignment() {
211213
for (size_t i = 0; i < N; ++i)
212214
CHECK(v[i] == T(i));
213215
if !consteval {
214-
CHECK_THROWS(
215-
([&] { const vector<T, N> x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; }()),
216-
std::bad_alloc);
216+
CHECK_THROWS(([&] {
217+
[[maybe_unused]] const vector<T, N> x = {0, 1, 2, 3, 4, 5,
218+
6, 7, 8, 9, 10};
219+
}()),
220+
std::bad_alloc);
217221
}
218222
}
219223

@@ -360,7 +364,7 @@ int main() {
360364
CHECK(a.size() == std::size_t(10));
361365
CHECK(!a.empty());
362366
CHECK_THROWS(a.push_back(0), std::bad_alloc);
363-
CHECK((uintptr_t) nullptr == (uintptr_t)a.try_push_back(0));
367+
CHECK((uintptr_t)nullptr == (uintptr_t)a.try_push_back(0));
364368
}
365369

366370
{ // resize copyable
@@ -758,7 +762,7 @@ int main() {
758762
CHECK(c.front().getd() == 3.5);
759763
CHECK(c.back().geti() == 3);
760764
CHECK(c.back().getd() == 4.5);
761-
CHECK((uintptr_t) nullptr == (uintptr_t)c.try_emplace_back(2, 3.5));
765+
CHECK((uintptr_t)nullptr == (uintptr_t)c.try_emplace_back(2, 3.5));
762766
}
763767
{ // unchecked_emplace_back
764768
vector<non_copyable, 2> c;

0 commit comments

Comments
 (0)