diff options
author | Jordan Maples <jomaples@microsoft.com> | 2020-04-10 02:15:08 +0300 |
---|---|---|
committer | Jordan Maples <jomaples@microsoft.com> | 2020-04-10 02:15:08 +0300 |
commit | ffbfcc0a9fecd7740440bfc8ab3dec7a0108ed87 (patch) | |
tree | 17a93270d4149097dd5846f73d5593218932588f /tests | |
parent | 5ca02327c4ca3d67f66094c7b5c92f3eb86d4d11 (diff) |
apply clang-format to the span_compatibility_tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/span_compatibility_tests.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/span_compatibility_tests.cpp b/tests/span_compatibility_tests.cpp index b1be4cb..e8981d1 100644 --- a/tests/span_compatibility_tests.cpp +++ b/tests/span_compatibility_tests.cpp @@ -42,14 +42,14 @@ static_assert(std::is_convertible<Derived*, Base*>::value, "std::is_convertible< static_assert(!std::is_convertible<Derived (*)[], Base (*)[]>::value, "!std::is_convertible<Derived(*)[], Base(*)[]>"); -// int*(*) [], int const* const(*)[] was identified as an issue in CWG330 and the resolution was provided with N4261 -// The changes were not backported to all versions of the compilers that GSL supports. -// The `if constexpr` should prevent codegen from happening if it is not supported however a few compilers continue to complain about the logic within. -// Filtering g++ version < 8, clang version < 7, and XCode 9.4 and 10.1 which looks to be Apple clang versions 9.1 and 10.0. -#if (defined(_MSC_VER)) || \ -(defined(__GNUC__) && __GNUC__ > 7) || \ -(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ > 10 ) || \ -(!defined(__APPLE__) && defined(__clang__) && __clang_major__ > 6) +// int*(*) [], int const* const(*)[] was identified as an issue in CWG330 and the resolution was +// provided with N4261. The changes were not backported to all versions of the compilers that GSL +// supports. The `if constexpr` should prevent codegen from happening if it is not supported however +// a few compilers continue to complain about the logic within. Filtering g++ version < 8, clang +// version < 7, and XCode 9.4 and 10.1 which looks to be Apple clang versions 9.1 and 10.0. +#if (defined(_MSC_VER)) || (defined(__GNUC__) && __GNUC__ > 7) || \ + (defined(__APPLE__) && defined(__clang_major__) && __clang_major__ > 10) || \ + (!defined(__APPLE__) && defined(__clang__) && __clang_major__ > 6) template <class = void> void ArrayConvertibilityCheck() { @@ -65,18 +65,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<decltype(span{stl_nullptr}), span<int*, 3>>::value, - "std::is_same< decltype(span{stl_nullptr}), span<int*, 3>>::value"); - static_assert( - std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>>::value, - "std::is_same< decltype(span{std::as_const(stl_nullptr)}), span<int* const, " - "3>>::value"); + static_assert(std::is_same<decltype(span{stl_nullptr}), span<int*, 3>>::value, + "std::is_same< decltype(span{stl_nullptr}), span<int*, 3>>::value"); + static_assert( + std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>>::value, + "std::is_same< decltype(span{std::as_const(stl_nullptr)}), span<int* const, " + "3>>::value"); } #endif } #else template <class = void> -void ArrayConvertibilityCheck(){} +void ArrayConvertibilityCheck() +{} #endif TEST(span_compatibility_tests, assertion_tests) |