[LLVMbugs] [Bug 10249] New: Missing functions in string.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 2 10:14:57 PDT 2011


           Summary: Missing functions in string.cpp
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu

The following program compiles, but does not link with clang r134322 and libc++

#include <string>

int main(int, char** argv)
    std::string    s;

    s.append(argv[0], argv[0] + 1);

clang++ -std=c++0x -stdlib=libc++ clang.cpp 
Undefined symbols:
referenced from:
      _main in cc-u2Adwb.o

The reason for this is the missing implementation of a few specialized template
methods in libc++'s string.cpp file (only the prototypes are there).

Commenting the "extern template ..." lines in <string> (lines 3972 to 4020)
makes the problem go away (as the compiler simply instanciates the
non-specialized template methods).

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