diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h --- a/libcxx/include/__iterator/common_iterator.h +++ b/libcxx/include/__iterator/common_iterator.h @@ -274,7 +274,7 @@ using type = decltype(declval>().operator->()); }; -template +template struct iterator_traits> { using iterator_concept = _If, forward_iterator_tag, diff --git a/libcxx/test/std/iterators/predef.iterators/iterators.common/iterator_traits.compile.pass.cpp b/libcxx/test/std/iterators/predef.iterators/iterators.common/iterator_traits.compile.pass.cpp --- a/libcxx/test/std/iterators/predef.iterators/iterators.common/iterator_traits.compile.pass.cpp +++ b/libcxx/test/std/iterators/predef.iterators/iterators.common/iterator_traits.compile.pass.cpp @@ -17,6 +17,9 @@ #include "test_macros.h" #include "types.h" +template +concept HasIteratorConcept = requires { typename T::iterator_concept; }; + void test() { { using Iter = simple_iterator; @@ -48,12 +51,12 @@ using CommonIter = std::common_iterator>; using IterTraits = std::iterator_traits; - static_assert(std::same_as); - static_assert(std::same_as); - static_assert(std::same_as); + static_assert(!HasIteratorConcept); + static_assert(std::same_as); + static_assert(std::same_as); static_assert(std::same_as); static_assert(std::same_as); - static_assert(std::same_as); + static_assert(std::same_as); } { using Iter = cpp17_input_iterator;