This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
New Bug (#1)
- To: egcs at cygnus dot com (egcs at cygnus dot com)
- Subject: New Bug (#1)
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Tue, 30 Jun 1998 15:41:04 +0200 (CEST)
I think this is a bug.
It's pretty complex, but I can't get it simpler without
that the problem goes away (it was 12,000 lines before
I started to simplify it).
~/c++/egcs.bugs/bug1>g++ bug1.cc
/tmp/ccdHCJV0: In function `A<D, C>::A(int)':
/tmp/ccdHCJV0(.A<D, C>::gnu.linkonce.t.(int)+0x23): undefined reference to `A<D, C>::V virtual table'
collect2: ld returned 1 exit status
~/c++/egcs.bugs/bug1>g++ -c bug1.cc
~/c++/egcs.bugs/bug1>nm -C bug1.o | grep 'virtual'
00000000 W V virtual table
U A<D, C>::V virtual table
00000000 W B<A<C, D> > virtual table
If I didn't make a mistake, and this is really a bug,
then please confirm and allow me to write to the patch
that adds a test for this :) (I gotta learn that too).
--
Carlo Wood <carlo@runaway.xs4all.nl>
-------------------
class V {
public:
virtual void v(void) { }
};
template <class T1, class T2>
class A : virtual public V {
typedef A<T2, T1> reversed_t;
};
template <class T>
class B {
public:
virtual void f(void) { typename T::reversed_t foo; }
};
class C { };
class D { };
int main(void)
{
B<A<C, D> > bar;
return 0;
}