This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14098] New: typeinfo issue with __gnu_cxx::stdio_sync_filebuf
- From: "Richard dot Kreckel at Framatome-ANP dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2004 16:12:08 -0000
- Subject: [Bug libstdc++/14098] New: typeinfo issue with __gnu_cxx::stdio_sync_filebuf
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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