[LLVMbugs] [Bug 7376] New: Clang produces linker error on explicit template instantiation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 14 11:42:33 PDT 2010


           Summary: Clang produces linker error on explicit template
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ebo at 4geeks.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

When compiling the attached files with clang, it produces the following linker

template.os:(.gnu.linkonce.d.rel.ro._ZTV1BIiE+0x8): undefined reference to
`typeinfo for B<int>'
collect2: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see

This works without problems when compiling with g++ (Ubuntu 4.4.3-4ubuntu5)

Commands used to build:

clang++ -c -o template.o template.cc
clang++ -c -o main.o main.cc
clang++ -o template main.os template.os

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