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

           Summary: Confusing error message with deleted implicit copy
                    constructors/assignment operators
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Consider the following code (adapted from libc++):

template <class _T1, class _T2>
struct __compressed_pair
{
    __compressed_pair() {}
    __compressed_pair(__compressed_pair&&) {}
};

typedef __compressed_pair<int, int>    P;

P foo();

int main(int, char**)
{
    P s;
    s = foo();
}


Compiling this with clang r133996 results in:

$ clang -std=c++0x clang.cpp
clang.cpp:15:4: error: overload resolution selected deleted operator '='
        s = foo();
        ~ ^ ~~~~~
clang.cpp:2:8: note: candidate function (the implicit copy assignment operator)
has been explicitly
      deleted
struct __compressed_pair
       ^
1 error generated.


This behaviour is correct as per 12.8p18, however the error message is quite
confusing: How can an *implicit* operator be *explicitely* deleted? I think the
note should end with "... by the explicit move {constructor|assignment
operator}". Also, it should point to this move constructor/operator instead of
to the beginning of the class definition.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to