[Bug libstdc++/65754] New: [5 Regression] missing exports for fstream constructors

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 13 18:17:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65754

            Bug ID: 65754
           Summary: [5 Regression] missing exports for fstream
                    constructors
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

Jakub noticed that I'd missed some symbols in the linker script, so this
doesn't link with the new string ABI:

// { dg-options "-std=gnu++11 -O0 -D_GLIBCXX_USE_CXX11_ABI=1" }
// { dg-do link }

#include <fstream>
#include <string>

using namespace std;

string s;

template<typename T> struct F : T { F() : T(s) { } };

int main()
{
  F<fstream>  fee;
  F<ifstream> fi;
  F<ofstream> fo;
#ifdef _GLIBCXX_USE_WCHAR_T
  F<wfstream> fum;
  F<wifstream> fiw;
  F<wofstream> fow;
#endif
}



/tmp/ccC52ARm.o: In function `F<std::basic_fstream<char, std::char_traits<char>
> >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_fstream<char,
std::char_traits<char> >::basic_fstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/tmp/ccC52ARm.o: In function `F<std::basic_ifstream<char,
std::char_traits<char> > >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_ifstream<char,
std::char_traits<char> >::basic_ifstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/tmp/ccC52ARm.o: In function `F<std::basic_ofstream<char,
std::char_traits<char> > >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_ofstream<char,
std::char_traits<char> >::basic_ofstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/tmp/ccC52ARm.o: In function `F<std::basic_fstream<wchar_t,
std::char_traits<wchar_t> > >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_fstream<wchar_t,
std::char_traits<wchar_t> >::basic_fstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/tmp/ccC52ARm.o: In function `F<std::basic_ifstream<wchar_t,
std::char_traits<wchar_t> > >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_ifstream<wchar_t,
std::char_traits<wchar_t> >::basic_ifstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/tmp/ccC52ARm.o: In function `F<std::basic_ofstream<wchar_t,
std::char_traits<wchar_t> > >::F()':
/tmp/f.cc:11: undefined reference to `std::basic_ofstream<wchar_t,
std::char_traits<wchar_t> >::basic_ofstream(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
collect2: error: ld returned 1 exit status



More information about the Gcc-bugs mailing list