Index: libcxx/include/__iterator/move_iterator.h =================================================================== --- libcxx/include/__iterator/move_iterator.h +++ libcxx/include/__iterator/move_iterator.h @@ -60,18 +60,19 @@ #endif { private: - - static constexpr auto _Get_Iterator_Tag() { - if constexpr (__is_cpp17_random_access_iterator<_Iter>::value) { + #if _LIBCPP_STD_VER > 17 + static consteval auto _get_iterator_concept() { + if constexpr (random_access_iterator<_Iter>) { return random_access_iterator_tag{}; - } else if constexpr (__is_cpp17_forward_iterator<_Iter>::value) { - return forward_iterator_tag{}; - } else if constexpr (__is_cpp17_bidirectional_iterator<_Iter>::value) { + } else if constexpr (bidirectional_iterator<_Iter>) { return bidirectional_iterator_tag{}; + } else if constexpr (forward_iterator<_Iter>) { + return forward_iterator_tag{}; } else { return input_iterator_tag{}; } } + #endif //_LIBCPP_STD_VER > 17 template friend class move_iterator; _Iter __current_; @@ -79,7 +80,7 @@ public: #if _LIBCPP_STD_VER > 17 using iterator_type = _Iter; - using iterator_concept = decltype(_Get_Iterator_Tag()); + using iterator_concept = decltype(_get_iterator_concept()); // iterator_category is inherited and not always present using value_type = iter_value_t<_Iter>; using difference_type = iter_difference_t<_Iter>; Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp @@ -142,11 +142,11 @@ #if TEST_STD_VER > 17 test>(); - static_assert(std::is_same_v>::iterator_concept, std::input_iterator_tag>); - static_assert(std::is_same_v>::iterator_concept, std::input_iterator_tag>); - static_assert(std::is_same_v>::iterator_concept, std::input_iterator_tag>); - static_assert(std::is_same_v>::iterator_concept, std::input_iterator_tag>); - static_assert(std::is_same_v::iterator_concept, std::input_iterator_tag>); + static_assert(std::is_same_v>::iterator_concept, std::forward_iterator_tag>); + static_assert(std::is_same_v>::iterator_concept, std::bidirectional_iterator_tag>); + static_assert(std::is_same_v>::iterator_concept, std::random_access_iterator_tag>); + static_assert(std::is_same_v>::iterator_concept, std::random_access_iterator_tag>); + static_assert(std::is_same_v::iterator_concept, std::random_access_iterator_tag>); #endif return 0;