[Bug 204329] clang++ does not resolve reference to STL member function

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Nov 6 11:00:02 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204329

            Bug ID: 204329
           Summary: clang++ does not resolve reference to STL member
                    function
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: egilb at ife.no

Created attachment 162848
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=162848&action=edit
Shell script for compiling test-snippet

The one-line c++ main function

  #include <string>

  template < typename T > int f( T );

  int main()
  {
    return f( &std::string::c_str );
  }

should have only one unresolved reference. The clang-compilers
available on FreeBSD 10.2 does not instantiate the STL member
function. Gcc installed from the ports collections seems to
do it correctly. A script compiling the source code shown above
is attached. The result is, when trying gcc and different versions
of clang compilers:

FreeBSD

  gcc version 5.2.0 (FreeBSD Ports Collection) 
    undefined reference to `int f<char const*  ...

  FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
    undefined reference to `std::__1::basic_st ...
    undefined reference to `int f<char const*  ...

  clang version 3.6.2 (tags/RELEASE_362/final)
    undefined reference to `std::__1::basic_st ...
    undefined reference to `int f<char const*  ...

  clang version 3.8.0 
    undefined reference to `std::__1::basic_st ...
    undefined reference to `int f<char const*  ...

This behavior was not experienced when llvm/clang was
installed from the source code on a Linux computer
( CentOS 6.2, clang installed as described on the
web page https://github.com/rsmmr/install-clang ):

Linux

  gcc version 5.2.0 (GCC) 
    undefined reference to `int f<char const*  ...

  clang version 3.4.1 
    undefined reference to `int f<char const*  ...

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list