From 7fcc142ffc9c73c891ca96ff3d84c17a03e6d230 Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Wed, 5 Feb 2020 14:32:08 -0800 Subject: [PATCH] addressing travis errors --- include/gsl/span | 8 ++++---- tests/span_tests.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/gsl/span b/include/gsl/span index fbb3758..f8dd4a0 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -163,7 +163,7 @@ namespace details constexpr span_iterator operator++(int) noexcept { - span_iterator ret = {*this}; + auto ret{*this}; ++*this; return ret; } @@ -178,7 +178,7 @@ namespace details constexpr span_iterator operator--(int) noexcept { - span_iterator ret = {*this}; + auto ret{*this}; --*this; return ret; } @@ -194,7 +194,7 @@ namespace details constexpr span_iterator operator+(const difference_type n) const noexcept { - span_iterator ret = {*this}; + auto ret{*this}; return ret += n; } @@ -215,7 +215,7 @@ namespace details constexpr span_iterator operator-(const difference_type n) const noexcept { - span_iterator ret = {*this}; + auto ret{*this}; return ret -= n; } diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp index 9dbfb42..c1dbbef 100644 --- a/tests/span_tests.cpp +++ b/tests/span_tests.cpp @@ -1102,8 +1102,13 @@ TEST(span_test, from_array_constructor) { span s = a; span s2 = b; - EXPECT_DEATH(bool _ = (s.begin() == s2.begin()), deathstring); - EXPECT_DEATH(bool _ = (s.begin() <= s2.begin()), deathstring); +#if (__cplusplus > 201402L) + EXPECT_DEATH([[maybe_unused]] s.begin() == s2.begin(), deathstring); + EXPECT_DEATH([[maybe_unused]] s.begin() <= s2.begin(), deathstring); +#else + EXPECT_DEATH(s.begin() == s2.begin(), deathstring); + EXPECT_DEATH(s.begin() <= s2.begin(), deathstring); +#endif } }