[all-commits] [llvm/llvm-project] c3e15b: [libc++] Support simply `std::iterator_traits` in ...

Quuxplusone via All-commits all-commits at lists.llvm.org
Tue Dec 1 19:18:21 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3e15b3c1c1cb52c83686812a7640e1dd809d695
      https://github.com/llvm/llvm-project/commit/c3e15b3c1c1cb52c83686812a7640e1dd809d695
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M libcxx/test/std/iterators/iterator.primitives/iterator.traits/empty.fail.cpp

  Log Message:
  -----------
  [libc++] Support simply `std::iterator_traits` in the iterator_traits test.

This follows on from D56698. I copied this fix (simpler than D92142's)
from commit 66e6e37447b183b1c8bac9330a4658530d2d49e6.

Differential Revision: https://reviews.llvm.org/D92239


  Commit: 40950a44b9a6aefe17b130e291f8728b34844bce
      https://github.com/llvm/llvm-project/commit/40950a44b9a6aefe17b130e291f8728b34844bce
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M libcxx/include/thread
    A libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/robust_against_adl.pass.cpp

  Log Message:
  -----------
  [libc++] ADL-proof <thread>, and eliminate `using namespace chrono`.

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.

Differential Revision: https://reviews.llvm.org/D92243


  Commit: d586f92c9456a972ee475a021525c0522b89587b
      https://github.com/llvm/llvm-project/commit/d586f92c9456a972ee475a021525c0522b89587b
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M libcxx/include/__debug
    M libcxx/include/__hash_table
    M libcxx/include/__mutex_base
    M libcxx/include/__split_buffer
    M libcxx/include/__string
    M libcxx/include/__tree
    M libcxx/include/algorithm
    M libcxx/include/array
    M libcxx/include/barrier
    M libcxx/include/bit
    M libcxx/include/bitset
    M libcxx/include/cmath
    M libcxx/include/compare
    M libcxx/include/complex
    M libcxx/include/deque
    M libcxx/include/filesystem
    M libcxx/include/forward_list
    M libcxx/include/functional
    M libcxx/include/future
    M libcxx/include/iomanip
    M libcxx/include/iterator
    M libcxx/include/list
    M libcxx/include/memory
    M libcxx/include/numbers
    M libcxx/include/numeric
    M libcxx/include/random
    M libcxx/include/regex
    M libcxx/include/string_view
    M libcxx/include/type_traits
    M libcxx/include/typeinfo
    M libcxx/include/unordered_map
    M libcxx/include/utility
    M libcxx/include/variant
    M libcxx/include/vector

  Log Message:
  -----------
  [libc++] Consistently replace `std::` qualification with `_VSTD::` or nothing. NFCI.

I used a lot of `git grep` to find places where `std::` was being used
outside of comments and assert-messages. There were three outcomes:

- Qualified function calls, e.g. `std::move` becomes `_VSTD::move`.
    This is the most common case.

- Typenames that don't need qualification, e.g. `std::allocator` becomes `allocator`.
    Leaving these as `_VSTD::allocator` would also be fine, but I decided
    that removing the qualification is more consistent with existing practice.

- Names that specifically need un-versioned `std::` qualification,
    or that I wasn't sure about. For example, I didn't touch any code in
    <atomic>, <math.h>, <new>, or any ext/ or experimental/ headers;
    and I didn't touch any instances of `std::type_info`.

In some deduction guides, we were accidentally using `class Alloc = typename std::allocator<T>`,
despite `std::allocator<T>`'s type-ness not being template-dependent.
Because `std::allocator` is a qualified name, this did parse as we intended;
but what we meant was simply `class Alloc = allocator<T>`.

Differential Revision: https://reviews.llvm.org/D92250


  Commit: e181a6aeddc26ef0512b2dba94db6360ba32f2ff
      https://github.com/llvm/llvm-project/commit/e181a6aeddc26ef0512b2dba94db6360ba32f2ff
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M clang-tools-extra/clangd/Diagnostics.cpp
    M clang/docs/LibASTMatchersReference.html
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/templates.cpp
    M clang/test/Modules/Inputs/cxx-irgen-top.h
    M clang/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
    M libcxx/include/memory
    M llvm/include/llvm/ADT/simple_ilist.h
    M llvm/lib/Support/SmallVector.cpp
    M llvm/test/tools/llvm-cov/cov-comdat.test

  Log Message:
  -----------
  s/instantate/instantiate/ throughout. NFCI.

The static_assert in "libcxx/include/memory" was the main offender here,
but then I figured I might as well `git grep -i instantat` and fix all
the instances I found. One was in user-facing HTML documentation;
the rest were in comments or tests.


Compare: https://github.com/llvm/llvm-project/compare/6fb88c6cd52b...e181a6aeddc2


More information about the All-commits mailing list