[libcxx-commits] [PATCH] D118049: [libcxx][test] the domain of == for forward iterators is iterator values from the same range
Casey Carter via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 24 10:00:18 PST 2022
CaseyCarter marked an inline comment as done.
CaseyCarter added inline comments.
================
Comment at: libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp:57
typename C::iterator i2;
- assert ( i1 != i2 );
+ LIBCPP_ASSERT( i1 != i2 );
i2 = i1;
----------------
Quuxplusone wrote:
> > Default-initialized basic_string iterators are not portably in the domain of ==.
>
> Oh yeah, because they can conformingly be just garbage-initialized `const char*`s, right? Makes sense. We probably shouldn't even be testing this case, then.
I'll strike.
================
Comment at: libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp:221
int out[N] = {6, 7, 8, 9, 10};
- assert(!std::equal(in, in + N, in, out + N));
+ assert(!std::equal(in, in + N, out, out + N));
----------------
Quuxplusone wrote:
> Mild yikes. Did MSVC catch this with a warning, instrumented debug iterators, or otherwise?
Range validity checks - we check `first <= last` when both are pointers - caught both occurrences when the compiler decided to place `out` before `in` on the stack.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118049/new/
https://reviews.llvm.org/D118049
More information about the libcxx-commits
mailing list