<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - allocate_shared cannot allocate an allocator using allocator of same type"
href="https://llvm.org/bugs/show_bug.cgi?id=22978">22978</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>allocate_shared cannot allocate an allocator using allocator of same type
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>donutydonuts+clang@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <iostream>
#include <memory>
int main() {
auto a = std::allocate_shared<std::allocator<int>>(std::allocator<int>{});
return 0;
}
===[[[ERROR OUTPUT]]]===
../include/c++/v1/memory:2045:40: error: multiple overloads of
'__libcpp_compressed_pair_imp' instantiate to the same signature
'void (_T2_param)'
_LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param
__t2)
^
../include/c++/v1/memory:2298:15: note: in instantiation of template class
'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<int>,
std::__1::allocator<int>, 1>' requested here
: private __libcpp_compressed_pair_imp<_T1, _T2>
^
../include/c++/v1/memory:3686:36: note: in instantiation of template class
'std::__1::__compressed_pair<std::__1::allocator<int>,
std::__1::allocator<int> >' requested here
__compressed_pair<_Alloc, _Tp> __data_;
^
../include/c++/v1/memory:4289:26: note: in instantiation of template class
'std::__1::__shared_ptr_emplace<std::__1::allocator<int>,
std::__1::allocator<int> >' requested here
::new(__hold2.get()) _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
^
../include/c++/v1/memory:4642:29: note: in instantiation of function template
specialization
'std::__1::shared_ptr<std::__1::allocator<int>
<span class="quote">>::allocate_shared<std::__1::allocator<int>>' requested here</span >
return shared_ptr<_Tp>::allocate_shared(__a,
_VSTD::forward<_Args>(__args)...);
It seems to be accepted on GCC compiler. Here is a online version:
<a href="http://ideone.com/W5C8US">http://ideone.com/W5C8US</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>