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

           Summary: Direct-initialization of class object by its own class
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Clang does not like the following code

struct A {
  A(int) { }
  explicit A(A const&) { }
};

int main() { 
  A a = 1;
}

The copy of the created A temporary to "a" is direct-initialization and so
needs to consider the explicit copy constructor. But clang says

  main1.cpp:7:5: error: no viable constructor copying variable of type 'A'

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