[LLVMbugs] [Bug 6570] New: Implicit copy-assignment operator hidden by overloaded assignment operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 10 04:19:34 PST 2010


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

           Summary: Implicit copy-assignment operator hidden by overloaded
                    assignment operator
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ahaczewski at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The test case:

class A {
};

class B {
public:
       B() {}

       B(const A& a) {
               operator = (CONST);
               operator = (a);
       }

       B& operator = (const A& a) {
               return *this;
       }

       static const B CONST;
};

And the diagnostics:
t3.cc:13:15: error: no viable conversion from 'class B const' to 'class A
const'
               operator = (CONST);
                           ^~~~~
t3.cc:1:7: note: candidate constructor (the implicit copy constructor)
not viable: no known conversion from 'class B const' to 'class A
const' for 1st argument
class A {
     ^
2 diagnostics generated.

GCC compiles it without problems.

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