[libc++] Fix allocate_shared when used with an explicitly convertible allocator
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 15 Dec 2020 16:45:53 +0000 (11:45 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 15 Dec 2020 16:50:06 +0000 (11:50 -0500)
commita00290ed10a6b4e9f6e9be44ceec367562f270c6
treeb01cffee40b041bc46561c1fcfb36cf53878d132
parent380e1d918cb4581fae0277ff547d75334f3e7ddd
[libc++] Fix allocate_shared when used with an explicitly convertible allocator

When the allocator is only explicitly convertible from other specializations
of itself, the new version of std::allocate_shared would not work because
it would try to do an implicit conversion. This patch fixes the problem
and adds a test so that we don't fall into the same trap in the future.
libcxx/include/__memory/utilities.h
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.explicit_conversion.pass.cpp [new file with mode: 0644]