This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/14098] New: typeinfo issue with __gnu_cxx::stdio_sync_filebuf


Consider this program:

#include <iostream>
#include <typeinfo>
#include <ext/stdio_sync_filebuf.h>
using namespace std;
typedef __gnu_cxx::stdio_sync_filebuf< char > unix_sync_filebuf_t;
int main()
{
    if ( dynamic_cast< unix_sync_filebuf_t* >( cout.rdbuf() ) ) {
	cout << "It's a C FILE." << endl;
    }
}

$ g++-3.4-20040206 test.cc
/tmp/cckpk27u.o(.text+0x13d): In function `main':
: undefined reference to `typeinfo for __gnu_cxx::stdio_sync_filebuf<char,
std::char_traits<char> >'
collect2: ld returned 1 exit status

Compiling statically fixes the problem:

$ g++-3.4-20040206 test.cc -static  &&  ./a.out
It's a C FILE.

Maybe this could be related to PR14097.

-- 
           Summary: typeinfo issue with __gnu_cxx::stdio_sync_filebuf
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Richard dot Kreckel at Framatome-ANP dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14098


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]