[libcxx-commits] [PATCH] D129794: [libc++] Fix reverse_iterator::iterator_concept

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 18 13:47:25 PDT 2022


huixie90 added inline comments.


================
Comment at: libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.compile.pass.cpp:118
   static_assert(std::is_same_v<typename std::reverse_iterator<bidirectional_iterator<char*>>::iterator_concept, std::bidirectional_iterator_tag>);
   static_assert(std::is_same_v<typename std::reverse_iterator<random_access_iterator<char*>>::iterator_concept, std::random_access_iterator_tag>);
+  static_assert(std::is_same_v<typename std::reverse_iterator<cpp20_random_access_iterator<char*>>::iterator_concept, std::random_access_iterator_tag>);
----------------
Mordante wrote:
> Why does this still pass?
I guess `random_access_iterator<char*>` is both c++20 `random_access_iterator` and c++17 `random_access_iterator` so the test would pass anyways. the new `cpp20_random_access_iterator` is c++20 `random_access_iterator` but only c++17 `input_iterator`, which would fail the test if the bug weren't fixed


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129794/new/

https://reviews.llvm.org/D129794



More information about the libcxx-commits mailing list