From 01d206f4d8997a01741ffe8f6ba719a747b7e014 Mon Sep 17 00:00:00 2001 From: Jordan Maples Date: Wed, 8 Apr 2020 14:38:01 -0700 Subject: [PATCH] adding additional filtering --- tests/span_compatibility_tests.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/span_compatibility_tests.cpp b/tests/span_compatibility_tests.cpp index e344e88..fa327f7 100644 --- a/tests/span_compatibility_tests.cpp +++ b/tests/span_compatibility_tests.cpp @@ -42,6 +42,7 @@ static_assert(std::is_convertible::value, "std::is_convertible< static_assert(!std::is_convertible::value, "!std::is_convertible"); +#if (defined(_MSC_VER)) || (defined(__GNUC__) && __GNUC__ > 7) || (defined(__clang__) && __clang_major__ > 6) template void ArrayConvertibilityCheck() { @@ -57,15 +58,19 @@ void ArrayConvertibilityCheck() EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data()); EXPECT_TRUE(sp_const_nullptr_2.size() == 3); - static_assert(std::is_same>::value, - "std::is_same< decltype(span{stl_nullptr}), span>::value"); - static_assert( - std::is_same>::value, - "std::is_same< decltype(span{std::as_const(stl_nullptr)}), span>::value"); + static_assert(std::is_same>::value, + "std::is_same< decltype(span{stl_nullptr}), span>::value"); + static_assert( + std::is_same>::value, + "std::is_same< decltype(span{std::as_const(stl_nullptr)}), span>::value"); } #endif } +#else +template +void ArrayConvertibilityCheck(){} +#endif TEST(span_compatibility_tests, assertion_tests) {