[all-commits] [llvm/llvm-project] a38a46: [libc++] fix `shared_ptr`'s incorrect constraints

Hui via All-commits all-commits at lists.llvm.org
Sat Feb 11 11:45:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a38a4654ce4b1d2ae8a03797d2e520e415150492
      https://github.com/llvm/llvm-project/commit/a38a4654ce4b1d2ae8a03797d2e520e415150492
  Author: Hui <hui.xie0621 at gmail.com>
  Date:   2023-02-11 (Sat, 11 Feb 2023)

  Changed paths:
    M libcxx/include/__memory/shared_ptr.h
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
    A libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_helper.h
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp

  Log Message:
  -----------
  [libc++] fix `shared_ptr`'s incorrect constraints

Fix several bugs:
1. https://llvm.org/PR60258
   The conversion constructors' constraint `__compatible_with` incorrectly allow array types conversion to scalar types
2. https://llvm.org/PR53368
   The constructor that takes `unique_ptr` are not suffiently constrained.
3. The constructors that take raw pointers incorretly use `__compatible_with`. They have different constraints

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




More information about the All-commits mailing list