Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoelf-Jilling <r-j.wolthuis@live.com>2020-01-14 19:38:42 +0300
committerRoelf-Jilling <r-j.wolthuis@live.com>2020-01-16 13:49:15 +0300
commitd08ff53e612c18e7cc3622b0ffb9476353b9d9d9 (patch)
treee5c2d314e7988474da94fb5e4393abeae5893d0f /tests/span_tests.cpp
parent186f5d21c13c2b8dffa86ba5610afedfafebd13b (diff)
Use [[maybe_unused]] with C++17
Diffstat (limited to 'tests/span_tests.cpp')
-rw-r--r--tests/span_tests.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
index d0da49d..20c8bc0 100644
--- a/tests/span_tests.cpp
+++ b/tests/span_tests.cpp
@@ -1287,7 +1287,11 @@ TEST(span_test, from_array_constructor)
auto beyond = s.rend();
EXPECT_TRUE(it != beyond);
- EXPECT_DEATH(auto _ = *beyond , deathstring);
+#if (__cplusplus > 201402L)
+ EXPECT_DEATH([[maybe_unused]] auto _ = *beyond , deathstring);
+#else
+ EXPECT_DEATH(auto _ = *beyond , deathstring);
+#endif
EXPECT_TRUE(beyond - first == 4);
EXPECT_TRUE(first - first == 0);
@@ -1332,7 +1336,11 @@ TEST(span_test, from_array_constructor)
auto beyond = s.crend();
EXPECT_TRUE(it != beyond);
- EXPECT_DEATH(auto _ = *beyond, deathstring);
+#if (__cplusplus > 201402L)
+ EXPECT_DEATH([[maybe_unused]] auto _ = *beyond, deathstring);
+#else
+ EXPECT_DEATH(auto _ = *beyond, deathstring);
+#endif
EXPECT_TRUE(beyond - first == 4);
EXPECT_TRUE(first - first == 0);