Mark shared_ptr::__create_with_control_block as noexcept.
Summary: The default constructor for shared_ptr and shared_ptr::__enable_weak_this are both noexcept so, shared_ptr::__create_with_control_block can also be marked noexcept.
Reviewers: ldionne, #libc!
Subscribers: dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D80070
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 21d4050e2c999ed183a345a2dcd6792c9b71bf60
diff --git a/include/memory b/include/memory
index 4962714..af9230c 100644
--- a/include/memory
+++ b/include/memory
@@ -3954,7 +3954,7 @@
template<class _Yp, class _CntrlBlk>
static shared_ptr<_Tp>
- __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl)
+ __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT
{
shared_ptr<_Tp> __r;
__r.__ptr_ = __p;