This is the mail archive of the gcc@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]

New Bug (#1)


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;
}


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