diff options
author | Jordan Maples <jomaples@microsoft.com> | 2020-03-18 01:02:00 +0300 |
---|---|---|
committer | Jordan Maples <jomaples@microsoft.com> | 2020-03-18 01:02:00 +0300 |
commit | 9b3ac8d681222a082231de712a4bd4299b658f11 (patch) | |
tree | 56af72620ef32caeae539eb5333f30eb29d56d54 /tests | |
parent | 1dd1320c8b29099fe5bba591d1b0dba367fa68d7 (diff) |
discussed the issue with Casey Carter, the span ctor changes are accurate but the tests are not. The test require work that was done in C++17 regarding qualifier conversions to work correctly. Scoping tests for 17.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/span_compatibility_tests.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/span_compatibility_tests.cpp b/tests/span_compatibility_tests.cpp index 1985f6f..acd85c5 100644 --- a/tests/span_compatibility_tests.cpp +++ b/tests/span_compatibility_tests.cpp @@ -48,20 +48,22 @@ TEST(span_compatibility_tests, assertion_tests) std::array<int, 3> stl{{100, 200, 300}}; std::array<int*, 3> stl_nullptr{{nullptr,nullptr,nullptr}}; +#if __cplusplus >= 201703l + // This std::is_convertible_v<int*(*)[], int const* const(*)[]> fails for C++14 + // so these conversions aren't valid in C++14 { gsl::span<const int* const> sp_const_nullptr_1{stl_nullptr}; EXPECT_TRUE(sp_const_nullptr_1.data() == stl_nullptr.data()); EXPECT_TRUE(sp_const_nullptr_1.size() == 3); -#if __cplusplus >= 201703l span<const int* const> sp_const_nullptr_2{std::as_const(stl_nullptr)}; EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data()); EXPECT_TRUE(sp_const_nullptr_2.size() == 3); static_assert(std::is_same<decltype(span{stl_nullptr}), span<int*, 3>); static_assert(std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>); -#endif } +#endif { gsl::span<int> sp_dyn; |