[LLVMbugs] [Bug 12755] New: unable to compile explicit specialization of std::find with libc++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 7 08:17:27 PDT 2012


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

             Bug #: 12755
           Summary: unable to compile explicit specialization of std::find
                    with libc++
           Product: new-bugs
           Version: 3.0
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sbn at tbricks.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following small function can be successfully built using libstdc++, but
failed when using libc++

$ cat -n a.cpp 
     1  #include <algorithm>
     2  #include <vector>
     3  
     4  void foo(std::vector<int>& v)
     5  {
     6      std::find<std::vector<int>::const_iterator>(v.begin(), v.end(), 5);
     7  }
$ clang++ -c -stdlib=libc++ a.cpp 
In file included from a.cpp:2:
In file included from /usr/bin/../lib/c++/v1/vector:261:
/usr/bin/../lib/c++/v1/__bit_reference:1067:26: error: no type named
'__storage_type' in 'std::__1::__wrap_iter<const int *>'
    typedef typename _C::__storage_type                                        
  __storage_type;
            ~~~~~~~~~~~~~^~~~~~~~~~~~~~
a.cpp:6:49: note: in instantiation of template class
'std::__1::__bit_iterator<std::__1::__wrap_iter<const int *>, false>' requested
here
    std::find<std::vector<int>::const_iterator>(v.begin(), v.end(), 5);
                                                ^
In file included from a.cpp:2:
In file included from /usr/bin/../lib/c++/v1/vector:261:
/usr/bin/../lib/c++/v1/__bit_reference:1068:57: error: no type named
'__const_storage_pointer' in 'std::__1::__wrap_iter<const int *>'
    typedef typename conditional<_IsConst, typename
_C::__const_storage_pointer,
                                           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/__bit_reference:1070:49: error: no member named
'__bits_per_word' in 'std::__1::__wrap_iter<const int *>'
    static const unsigned __bits_per_word = _C::__bits_per_word;
                                            ~~~~^
/usr/bin/../lib/c++/v1/__bit_reference:1187:25: error: no type named '__self'
in 'std::__1::__wrap_iter<const int *>'
    friend typename _C::__self;
           ~~~~~~~~~~~~~^~~~~~
4 errors generated.
$ clang++ -c a.cpp
$ clang++ -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list