Skip to content

Commit 06b63c1

Browse files
authored
Suppress C5258 in MemoryStorageTests. (#1164)
1 parent 8032b1a commit 06b63c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/unittests/MemoryStorageTests.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ TEST(MemoryStorageTests, GetAndReserveSome)
258258
#if defined(__clang__)
259259
#pragma clang diagnostic push // This appears to be a detection bug with constexpr variables in Clang9
260260
#pragma clang diagnostic ignored "-Wunused-lambda-capture" // error : lambda capture 'howMany' is not required to be captured for this use[-Werror, -Wunused - lambda - capture]
261+
#elif defined(_MSC_VER)
262+
#pragma warning(push)
263+
#pragma warning(disable : 5258) // warning C5258: explicit capture of 'howMany' is not required for this use
261264
#endif
262265
storage.GetAndReserveRecords(
263266
[&someRecords, howMany] (StorageRecord && record)->bool
@@ -272,6 +275,8 @@ TEST(MemoryStorageTests, GetAndReserveSome)
272275
);
273276
#if defined(__clang__)
274277
#pragma clang diagnostic pop
278+
#elif defined(_MSC_VER)
279+
#pragma warning(pop)
275280
#endif
276281

277282
EXPECT_EQ(howMany, someRecords.size());

0 commit comments

Comments
 (0)