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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 19 13:02:30 PDT 2022


Mordante 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>);
----------------
huixie90 wrote:
> 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
Thanks for the explanation @huixie90. @philnik if you agree with that assessment, can you use that as comment in the code.


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