[LLVMbugs] [Bug 18350] New: can't compile tuple<unique_ptr<char []>>foo;

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 31 21:21:06 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18350

            Bug ID: 18350
           Summary: can't compile tuple<unique_ptr<char []>>foo;
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: cfy1990 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat tuple.cc 
#include <tuple>
#include <memory>

int main(void){
    using namespace std;
    tuple<unique_ptr<char []>> b;
}                                                                              
                                                                               
                        $ clang++ -std=c++11 -Wall -Wextra -stdlib=libc++ -O2
tuple.cc -o tuple.out
In file included from tuple.cc:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:918:22:
error: implicit instantiation of undefined template
      'std::__1::__pointer_traits_element_type<std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false>,
false>'
    typedef typename __pointer_traits_element_type<pointer>::type   
element_type;
                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2451:54:
note: in instantiation of template class
      'std::__1::pointer_traits<std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false> >'
requested here
          bool = is_same<typename remove_cv<typename
pointer_traits<_Ptr1>::element_type>::type,
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2465:7:
note: in instantiation of default argument for
      '__same_or_less_cv_qualified_imp<std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false>, char
*>' required here
    : __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2> {};
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2732:42:
note: in instantiation of template class
      'std::__1::__same_or_less_cv_qualified<std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false>, char
*, false>' requested here
              class = typename enable_if<__same_or_less_cv_qualified<_Pp,
pointer>::value>::type
                                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2734:40:
note: in instantiation of default argument for
      'unique_ptr<std::__1::__tuple_leaf<0, std::__1::unique_ptr<char [],
std::__1::default_delete<char []> >, false> >' required here
    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p) _NOEXCEPT
                                       ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2734:40:
note: while substituting deduced template arguments into function
      template 'unique_ptr' [with _Pp = std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false>, $1 =
<no value>]
    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p) _NOEXCEPT
                                       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:1829:1:
note: (skipping 1 context in backtrace; use
      -ftemplate-backtrace-limit=0 to see all)
__is_constructible_test(_Tp&&, _Args&& ...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:1888:14:
note: in instantiation of template class
      'std::__1::__is_constructible<false, std::__1::unique_ptr<char [],
std::__1::default_delete<char []> >, const std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [],
      std::__1::default_delete<char []> >, false> &>' requested here
    : public __is_constructible<is_scalar<_Tp>::value ||
is_reference<_Tp>::value,
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:1914:14:
note: in instantiation of template class
      'std::__1::__is_constructible_void_check<false, std::__1::unique_ptr<char
[], std::__1::default_delete<char []> >, const std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [],
      std::__1::default_delete<char []> >, false> &>' requested here
    : public __is_constructible_void_check<__contains_void<_Tp,
_Args...>::value
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:260:42:
note: in instantiation of template class
      'std::__1::is_constructible<std::__1::unique_ptr<char [],
std::__1::default_delete<char []> >, const std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [],
      std::__1::default_delete<char []> >, false> &>' requested here
              class = typename enable_if<is_constructible<_Hp,
_Tp>::value>::type>
                                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:262:18:
note: in instantiation of default argument for '__tuple_leaf<const
      std::__1::__tuple_leaf<0, std::__1::unique_ptr<char [],
std::__1::default_delete<char []> >, false> &>' required here
        explicit __tuple_leaf(_Tp&& __t)
_NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
                 ^~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:262:18:
note: while substituting deduced template arguments into function
      template '__tuple_leaf' [with _Tp = const std::__1::__tuple_leaf<0,
std::__1::unique_ptr<char [], std::__1::default_delete<char []> >, false> &, $1
= <no value>]
        explicit __tuple_leaf(_Tp&& __t)
_NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:704:8:
note: template is declared here
struct __pointer_traits_element_type;
       ^
1 error generated.

-- 
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/20140101/23d5af18/attachment.html>


More information about the llvm-bugs mailing list