[all-commits] [llvm/llvm-project] 56df1d: [libc++] Use addressof in vector.

mordante via All-commits all-commits at lists.llvm.org
Thu Oct 21 08:29:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 56df1d80e2911a8cd23b70e9b7e76fcb386c7956
      https://github.com/llvm/llvm-project/commit/56df1d80e2911a8cd23b70e9b7e76fcb386c7956
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2021-10-21 (Thu, 21 Oct 2021)

  Changed paths:
    M libcxx/include/__iterator/wrap_iter.h
    M libcxx/include/vector
    A libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.cons/move.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.addressof.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/vector.special/swap.addressof.compile.pass.cpp

  Log Message:
  -----------
  [libc++] Use addressof in vector.

This addresses the usage of `operator&` in `<vector>`.

I now added tests for the current offending cases. I wonder whether it
would be better to add one addressof test per directory and test all
possible violations. Also to guard against possible future errors?

(Note there are still more headers with the same issue.)

Reviewed By: #libc, ldionne

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




More information about the All-commits mailing list