[PATCH] D52240: Partial Fix for PR#38964

Dimitry Andric via Phabricator reviews at reviews.llvm.org
Tue Sep 18 12:16:56 PDT 2018


dim added a comment.

Built with `mkdir build && cd build && cmake -G Ninja .. && ninja`, the resulting `libc++.so.1` has the following additional symbols:

  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*)
  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*, std::__1::allocator<char> const&)
  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char, std::__1::allocator<char> const&)
  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*)
  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*, std::__1::allocator<char> const&)
  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char, std::__1::allocator<char> const&)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(wchar_t const*)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(wchar_t const*, std::__1::allocator<wchar_t> const&)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(unsigned long, wchar_t, std::__1::allocator<wchar_t> const&)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(wchar_t const*)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(wchar_t const*, std::__1::allocator<wchar_t> const&)
  std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::basic_string(unsigned long, wchar_t, std::__1::allocator<wchar_t> const&)

So these are now instantiated in the .so file.  This is on FreeBSD, but I assume it will be the same on macOS and Linux; I can't check at the moment.

I also still get some errors when compiling `<string>` with g++ in c++03 mode:

  $ make
  echo "#include <string>" | g++ -std=c++03 -nostdinc++ -isystem /share/dim/src/libcxx/trunk/include -x c++ -c - -o -
  In file included from <stdin>:1:
  /share/dim/src/libcxx/trunk/include/string:850:75: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
                                 const allocator_type& __a = allocator_type());
                                                                             ^
  /share/dim/src/libcxx/trunk/include/string:854:45: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
           explicit basic_string(const _Tp& __t);
                                               ^
  /share/dim/src/libcxx/trunk/include/string:858:72: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
           explicit basic_string(const _Tp& __t, const allocator_type& __a);
                                                                          ^
  /share/dim/src/libcxx/trunk/include/string:881:43: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
       basic_string& operator=(const _Tp& __t)
                                             ^
  *** Error code 1
  
  Stop.
  make: stopped in /share/dim/src/llvm/bugs/pr38964


https://reviews.llvm.org/D52240





More information about the libcxx-commits mailing list