diff --git a/tests/test_mdarray_ctors.cpp b/tests/test_mdarray_ctors.cpp index d295a257..cf214062 100644 --- a/tests/test_mdarray_ctors.cpp +++ b/tests/test_mdarray_ctors.cpp @@ -141,36 +141,24 @@ void check_correctness(MDA& m, size_t rank, size_t rank_dynamic, bool exhaustive) { ASSERT_EQ(m.rank(), rank); ASSERT_EQ(m.rank_dynamic(), rank_dynamic); - if(rank>0) { - ASSERT_EQ(m.extent(0), extent_0); #if MDSPAN_HAS_CXX_20 - if constexpr (MDA::extents_type::rank()>0) { + if constexpr (MDA::extents_type::rank()>0) { #endif + if(rank>0) { + ASSERT_EQ(m.extent(0), extent_0); ASSERT_EQ(m.stride(0), stride_0); -#if MDSPAN_HAS_CXX_20 } -#endif - } - if(rank>1) { - ASSERT_EQ(m.extent(1), extent_1); -#if MDSPAN_HAS_CXX_20 - if constexpr (MDA::extents_type::rank()>0) { -#endif + if(rank>1) { + ASSERT_EQ(m.extent(1), extent_1); ASSERT_EQ(m.stride(1), stride_1); -#if MDSPAN_HAS_CXX_20 } -#endif - } - if(rank>2) { - ASSERT_EQ(m.extent(2), extent_2); -#if MDSPAN_HAS_CXX_20 - if constexpr (MDA::extents_type::rank()>0) { -#endif + if(rank>2) { + ASSERT_EQ(m.extent(2), extent_2); ASSERT_EQ(m.stride(2), stride_2); -#if MDSPAN_HAS_CXX_20 } -#endif +#if MDSPAN_HAS_CXX_20 } +#endif if(ptr_matches) ASSERT_EQ(m.data(),ptr); else