[libcxx-commits] [PATCH] D92243: [libc++] ADL-proof <thread>, and eliminate `using namespace chrono`.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 27 11:55:11 PST 2020


Quuxplusone created this revision.
Quuxplusone added a reviewer: ldionne.
Quuxplusone added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Quuxplusone requested review of this revision.

Since we know exactly which identifiers we expect to find in `chrono`, a using-directive seems like massive overkill. Remove the directives and qualify the names as needed.

One subtle trick here: In two places I replaced `*__p` with `*__p.get()`. The former is an unqualified call to `operator*` on a class type, which triggers ADL and breaks the new test. The latter is a call to the built-in `operator*` on pointers, which specifically does //not// trigger ADL thanks to (over.match.oper)/1 <http://eel.is/c++draft/over.match.oper#1>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92243

Files:
  libcxx/include/thread
  libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/robust_against_adl.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92243.308099.patch
Type: text/x-patch
Size: 5529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201127/69491ceb/attachment.bin>


More information about the libcxx-commits mailing list