Description of problem: [15:29:11 pal@localhost ~/tmp/bug]$ cat a.cpp #include <string> #include <ext/mt_allocator.h> //workaround: //template class std :: basic_string < char, std :: char_traits < char >, __gnu_cxx :: __mt_alloc < char > >; int main ( ) { std :: basic_string < char, std :: char_traits < char >, __gnu_cxx :: __mt_alloc < char > > s; s.push_back ( 'a' ); } [15:34:12 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp -frepo && LC_ALL=C g++ -o a a.o -frepo collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking collect: recompiling a.cpp collect: relinking a.o: In function `std::basic_string<char, std::char_traits<char>, __gnu_cxx::__mt_alloc<char, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> > >::_Rep::_M_set_length_and_sharable(unsigned long)': a.cpp:(.text+0x28b): undefined reference to `std::basic_string<char, std::char_traits<char>, __gnu_cxx::__mt_alloc<char, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> > >::_Rep::_S_terminal' collect2: ld returned 1 exit status [15:34:15 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp && LC_ALL=C g++ -o a a.o [15:35:10 pal@localhost ~/tmp/bug]$ Version-Release number of selected component (if applicable): [15:35:10 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ --version g++ (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8) Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. How reproducible: compile with -frepo .push_back() on basic_string with different allocator Actual results: link error Expected results: successful link Additional info: uncommenting workaround works but it defeats purpose of -frepo