From 0063e436502a222b930ed6ee07e876cd967b67f4 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 16 Dec 2019 15:42:10 +0100 Subject: [PATCH] silence buggy nodiscard diagnostic on MSVC --- test/test_http_parser.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_http_parser.cpp b/test/test_http_parser.cpp index ac32dd2c5..8756fc4ed 100644 --- a/test/test_http_parser.cpp +++ b/test/test_http_parser.cpp @@ -60,7 +60,18 @@ std::tuple feed_bytes(http_parser& parser, string_view str) std::tie(payload, protocol) = parser.incoming(recv_buf, error); std::get<0>(ret) += payload; std::get<1>(ret) += protocol; + +#ifdef _MSC_VER +#pragma warning(push, 1) +// this ia a buggy diagnostic on msvc +// warning C4834: discarding return value of function with 'nodiscard' attribute +#pragma warning( disable : 4834 ) +#endif std::get<2>(ret) |= error; + +#ifdef _MSC_VER +#pragma warning(pop) +#endif TORRENT_ASSERT(payload + protocol == chunk_size || std::get<2>(ret)); } TEST_CHECK(prev == std::make_tuple(0, 0, false) || ret == prev || std::get<2>(ret));