Code calling ostream::operator<<(streambuf*) fails to link with g++ 4.1.0 when _GLIBCXX_DEBUG is defined; more specifically, when _GLIBCXX_EXTERN_TEMPLATE is defined to 0. This problem is not observed with 1) g++ 4.0.1 on the same system or 2) the same configuration of g++ 4.1.0 for i686-linux
test.cc: """ #include <iostream> main() { std::cout << std::cin.rdbuf(); } """ [EMAIL PROTECTED] g++ -D_GLIBCXX_DEBUG test.cc /tmp/ccyq7RoG.o(.gnu.linkonce.t._ZNSolsEPSt15basic_streambufIcSt11char_traitsIcEE+0x75): In function `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_streambuf<char, std::char_traits<char> >*)': : undefined reference to `long std::__copy_streambufs<char, std::char_traits<char> >(std::basic_streambuf<char, std::char_traits<char> >*, std::basic_streambuf<char, std::char_traits<char> >*)' collect2: ld returned 1 exit status the same link error occurs using "g++ -D_GLIBCXX_EXTERN_TEMPLATE=0 test.cc" [EMAIL PROTECTED] g++ -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.1.0/configure -enable-languages=c,c++ --enable-concept-checks --enable-__cxa_atexit --disable-checking --prefix=/home/ctsa/opt/x86_64-linux/gcc-4.1 Thread model: posix gcc version 4.1.0 -- Summary: 4.1.0 regression: std::__copy_streambufs link failure when _GLIBCXX_DEBUG is defined Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ctsa at u dot washington dot edu GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26526