[libcxx-commits] [PATCH] D127669: [libc++] Robust against C++20-hostile iterators

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 13 13:40:28 PDT 2022

EricWF accepted this revision.
EricWF added a comment.

I still think it would be nice to produce a minimal test that actually ran (no need to check any output). Since having a runnable test would allow the sanitizers to pick up any weird bugs Cpp20HostileIterator causes at runtime.

But as a CI fix, this LGTM once the comments about undefined symbols have been addressed.

Comment at: libcxx/test/std/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp:67
+  Cpp20HostileIterator() {}
+  Cpp20HostileIterator(It it);
You'll want to define this constructor too.

Comment at: libcxx/test/std/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp:76
+void test() {
+  Cpp20HostileIterator<int*> it;
You might as well run these tests over some meaningful input. Then if our implementations do something else weird there's a chance the sanitizers can catch it.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list