[libc++] ADL-proof <vector> by adding _VSTD:: qualification on calls.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Wed, 18 Nov 2020 23:54:38 +0000 (18:54 -0500)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Thu, 19 Nov 2020 14:19:16 +0000 (09:19 -0500)
commit40267cc989e6d055d5e470681dc7bcfffc72c32f
tree6bf967e253ad7bf30fc486a797d2cb93eea74f6c
parent57e0007546abd6c73c54249705f4fe42592fd179
[libc++] ADL-proof <vector> by adding _VSTD:: qualification on calls.

(1) Add _VSTD:: qualification to __swap_allocator.

(2) Add _VSTD:: qualification consistently to __to_address.

(3) Add some more missing _VSTD:: to <vector>, with a regression test.
This part is cleanup after d9a4f936d05.

Note that a vector whose allocator actually runs afoul of any of these ADL calls will
likely also run afoul of simple things like `v1 == v2` (which is also an ADL call).
But, still, libc++ should be consistent in qualifying function calls wherever possible.

Relevant blog post: https://quuxplusone.github.io/blog/2019/09/26/uglification-doesnt-stop-adl/

Differential Revision: https://reviews.llvm.org/D91708
libcxx/include/__hash_table
libcxx/include/__split_buffer
libcxx/include/__tree
libcxx/include/deque
libcxx/include/forward_list
libcxx/include/list
libcxx/include/memory
libcxx/include/string
libcxx/include/vector
libcxx/test/libcxx/containers/sequences/vector/robust_against_adl.pass.cpp [new file with mode: 0644]