[Bug c++/11247] New: -frepo fails to instantiate typeinfo
bgreen at nas dot nasa dot gov
gcc-bugzilla@gcc.gnu.org
Wed Jun 18 23:44:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11247
Summary: -frepo fails to instantiate typeinfo
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: bgreen@nas.nasa.gov
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
The code presented does not link successfully when using the -frepo option.
The compiler fails to instantiate a typeinfo object in order to perform a
dynamic cast operation. Failure of the code to link successfully inhibits
library design.
The code builds successfully when not using '-frepo'.
[bgreen@ece06 ~/test]$ g++ -v
Reading specs from /home/bgreen/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: ../gcc/configure --prefix=/home/bgreen/local/gcc
--enable-__cxa_atexit --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.1 20030616 (prerelease)
[bgreen@ece06 ~/test]$ make
g++ -g -Wall -frepo -c -o test.o test.C
g++ -g -Wall -frepo -o test test.o
test.o(.text+0x28): In function `main':
/home/bgreen/test/test.C:18: undefined reference to `typeinfo for IType<int>'
collect2: ld returned 1 exit status
make: *** [test] Error 1
[bgreen@ece06 ~/test]$ cat test.C
class IBase
{
public:
virtual ~IBase() {}
};
template <typename T>
class IType : public IBase
{
public:
IType() {}
};
int main()
{
IBase *p = 0;
dynamic_cast<IType<int>*>(p);
}
More information about the Gcc-bugs
mailing list