[LLVMbugs] [Bug 22978] New: allocate_shared cannot allocate an allocator using allocator of same type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 21 22:23:40 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=22978

            Bug ID: 22978
           Summary: allocate_shared cannot allocate an allocator using
                    allocator of same type
           Product: clang
           Version: 3.6
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: donutydonuts+clang at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#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>
>::allocate_shared<std::__1::allocator<int>>' requested here
    return shared_ptr<_Tp>::allocate_shared(__a,
_VSTD::forward<_Args>(__args)...);



It seems to be accepted on GCC compiler. Here is a online version: 
http://ideone.com/W5C8US

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150322/bbac9777/attachment.html>


More information about the llvm-bugs mailing list