diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -610,7 +610,13 @@ template span(const array<_Tp, _Sz>&) -> span; -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +template + span(_Container&) -> span; + +template + span(const _Container&) -> span; +#else template span(_Range&&) -> span>>; #endif diff --git a/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp b/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp --- a/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp +++ b/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp @@ -85,7 +85,6 @@ } } -#ifndef TEST_HAS_NO_INCOMPLETE_RANGES void test_range_std_container() { { std::string str{"ABCDE"}; @@ -103,17 +102,13 @@ assert(s.data() == str.data()); } } -#endif // TEST_HAS_NO_INCOMPLETE_RANGES int main(int, char**) { test_iterator_sentinel(); test_c_array(); test_std_array(); - -#ifndef TEST_HAS_NO_INCOMPLETE_RANGES test_range_std_container(); -#endif // TEST_HAS_NO_INCOMPLETE_RANGES return 0; } diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -389,10 +389,6 @@ # define TEST_HAS_NO_FGETPOS_FSETPOS #endif -#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) -# define TEST_HAS_NO_INCOMPLETE_RANGES -#endif - #if defined(TEST_COMPILER_CLANG) # define TEST_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") # define TEST_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")