[libcxx-commits] [PATCH] D72640: [libcxx] Qualify make_pair in searcher implementations to prevent ADL

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 5 18:22:10 PDT 2020


EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

There are some simplifications suggested in the inline comments.
Once those are addressed, this LGTM.



================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp:51
     template <typename Iterator>
     std::pair<Iterator, Iterator>
     operator() (Iterator b, Iterator e) const
----------------
Please add a single additional test for each function that was fixed.
Separation of test concerns is better than carpet bombing the tests to prevent ADL,
and it makes the added test more understandable. 

Once that's done this diff should be much smaller than it currently is.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp:63
+    int x;
+    bool operator==(S other) const 
+    { 
----------------
Make this a non-member.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp:69
+template <class T, class U>
+void make_pair(T&&, U&&) {}
+} // namespace User
----------------
`= delete`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72640





More information about the libcxx-commits mailing list