[LLVMbugs] [Bug 11921] New: failed compilation involving tuple operator=

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 4 03:09:30 PST 2012


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

             Bug #: 11921
           Summary: failed compilation involving tuple operator=
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: SebastianLuther at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following program fails to compile with clang-3.0 and libc++-r149701.
gcc-4.5 doesn't report this error.
############test.cpp##############
#include <tuple>
#include <vector>

typedef std::tuple<int> T;

int main(int argc, char* argv[])
{
        std::vector<T> v1;
        const std::vector<T> v2;
        v1.insert(v1.end(), v2.begin(), v2.end());
}
##################################

$ g++ -std=c++0x tuple-test.cpp
$ 
$ clang++ -stdlib=libc++ -std=c++0x tuple-test.cpp
In file included from tuple-test.cpp:3:
In file included from /usr/include/c++/v1/vector:261:
In file included from /usr/include/c++/v1/__bit_reference:15:
/usr/include/c++/v1/algorithm:1501:19: error: overload resolution selected
deleted operator '='
        *__result = *__first;
        ~~~~~~~~~ ^ ~~~~~~~~
/usr/include/c++/v1/algorithm:1525:12: note: in instantiation of function
template specialization 'std::__1::__copy<std::__1::__wrap_iter<const
std::__1::tuple<int> *>,
      std::__1::tuple<int> *>' requested here
    return _VSTD::__copy(__unwrap_iter(__first), __unwrap_iter(__last),
__unwrap_iter(__result));
           ^
/usr/include/c++/v1/__config:251:15: note: expanded from:
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/usr/include/c++/v1/vector:1804:17: note: in instantiation of function template
specialization 'std::__1::copy<std::__1::__wrap_iter<const std::__1::tuple<int>
*>,
      std::__1::tuple<int> *>' requested here
                _VSTD::copy(__first, __m, __p);
                ^
/usr/include/c++/v1/__config:251:15: note: expanded from:
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
tuple-test.cpp:13:5: note: in instantiation of function template specialization
'std::__1::vector<std::__1::tuple<int>,
std::__1::allocator<std::__1::tuple<int> >
      >::insert<std::__1::__wrap_iter<const std::__1::tuple<int> *> >'
requested here
        v1.insert(v1.end(), v2.begin(), v2.end());
           ^
/usr/include/c++/v1/tuple:511:23: note: candidate function (the implicit copy
assignment operator) has been explicitly deleted
class _LIBCPP_VISIBLE tuple
                      ^
/usr/include/c++/v1/tuple:619:9: note: candidate function [with _Tuple = const
std::__1::tuple<int> &, $1 = void]
        operator=(_Tuple&& __t)
        ^
1 error generated.

-- 
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