[LLVMbugs] [Bug 9916] New: link-time undefined copy constructor when defaulting

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 14 07:15:32 PDT 2011


           Summary: link-time undefined copy constructor when defaulting
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hhinnant at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

I know this area is still under active development.  Just hoping to help with

The defaulted default constructor appears to be working well.  But I get a link
time error for the copy constructor:

Undefined symbols for architecture x86_64:
  "A::A(A const&)", referenced from:
      _main in cc-y6wi0g.o
ld: symbol(s) not found for architecture x86_64

class A
    A() = default;
    A(const A&) = default;

int main()
    A a;
    A a2 = a;

Apple clang version 3.0 (trunk 131335) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.7.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