-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++][test] overload_compare_iterator
doesn't support its claimed iterator_category
#74756
Labels
Comments
github-actions
bot
added
the
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
label
Dec 7, 2023
frederick-vs-ja
added a commit
that referenced
this issue
Oct 15, 2024
…12165) `overload_compare_iterator` only supports operations required for forward iterators. On the other hand, it is used for output iterators of uninitialized memory algorithms, which requires it to be forward iterator. As a result, `overload_compare_iterator<I>::iterator_category` should always be `std::forward_iterator_tag` if we don't extend its ability. The correct `iterator_category` can prevent standard library implementations like MSVC STL attempting random access operations on `overload_compare_iterator`. Fixes #74756.
bricknerb
pushed a commit
to bricknerb/llvm-project
that referenced
this issue
Oct 16, 2024
…vm#112165) `overload_compare_iterator` only supports operations required for forward iterators. On the other hand, it is used for output iterators of uninitialized memory algorithms, which requires it to be forward iterator. As a result, `overload_compare_iterator<I>::iterator_category` should always be `std::forward_iterator_tag` if we don't extend its ability. The correct `iterator_category` can prevent standard library implementations like MSVC STL attempting random access operations on `overload_compare_iterator`. Fixes llvm#74756.
DanielCChen
pushed a commit
to DanielCChen/llvm-project
that referenced
this issue
Oct 16, 2024
…vm#112165) `overload_compare_iterator` only supports operations required for forward iterators. On the other hand, it is used for output iterators of uninitialized memory algorithms, which requires it to be forward iterator. As a result, `overload_compare_iterator<I>::iterator_category` should always be `std::forward_iterator_tag` if we don't extend its ability. The correct `iterator_category` can prevent standard library implementations like MSVC STL attempting random access operations on `overload_compare_iterator`. Fixes llvm#74756.
bricknerb
pushed a commit
to bricknerb/llvm-project
that referenced
this issue
Oct 17, 2024
…vm#112165) `overload_compare_iterator` only supports operations required for forward iterators. On the other hand, it is used for output iterators of uninitialized memory algorithms, which requires it to be forward iterator. As a result, `overload_compare_iterator<I>::iterator_category` should always be `std::forward_iterator_tag` if we don't extend its ability. The correct `iterator_category` can prevent standard library implementations like MSVC STL attempting random access operations on `overload_compare_iterator`. Fixes llvm#74756.
EricWF
pushed a commit
to efcs/llvm-project
that referenced
this issue
Oct 22, 2024
…vm#112165) `overload_compare_iterator` only supports operations required for forward iterators. On the other hand, it is used for output iterators of uninitialized memory algorithms, which requires it to be forward iterator. As a result, `overload_compare_iterator<I>::iterator_category` should always be `std::forward_iterator_tag` if we don't extend its ability. The correct `iterator_category` can prevent standard library implementations like MSVC STL attempting random access operations on `overload_compare_iterator`. Fixes llvm#74756.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
There's an
overload_compare_iterator
that wraps anIterator
and claims to have the sameiterator_category
:llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/overload_compare_iterator.h
Lines 18 to 28 in 2b1c76c
However, it totally doesn't support enough operations. When passed to MSVC's STL, we notice that
overload_compare_iterator<int *>
claims to be random-access and we try to subtract it, which fails to compile:The text was updated successfully, but these errors were encountered: