Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Nov 2015 11:00:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 204329] clang++ does not resolve reference to STL member function
Message-ID:  <bug-204329-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: egilb@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-204329-13>