public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* virtual table referencing error.
@ 1998-04-06 17:35 Ruslan Shevchenko
  0 siblings, 0 replies; only message in thread
From: Ruslan Shevchenko @ 1998-04-06 17:35 UTC (permalink / raw)
  To: egcs

egcs sometimes not generate virtual tables in templatest.

I just strip my 2000-lines test to 167:

(olso in attachment)

#include ?iostream>

using namespace std;

template?class T>
class E;

template ?class T>
class A
{
public:
 typedef E?T> e_type;
public:
 virtual void x(void) = 0;
 virtual e_type* get_e(void) = 0;
};

template ?class T1,class T2,class T3>
class B: virtual public A?T2>
{
public:
 typedef A?T2>::e_type e_type;
 virtual void x(void)  { cout ?? "B::x\n"; }
 virtual void y(void)  { cout ?? "B::y\n"; }
 virtual e_type* get_e(void);
};

template ?class T>
class E
{
public:
 virtual void xx(void) = 0;
};

template?class T1, class T2, class T3>
class EB: virtual public E?T2>
{
public:
 virtual void xx(void) { cout ?? "EB::xx" ?? endl; }
};

template ?class T1, class T2, class T3>
B?T1,T2,T3>::e_type* B?T1,T2,T3>::get_e()
{
  return new EB?T1,T2,T3>;
}

template ?class T>
struct C
{
};


class D: virtual public B?C?int>,int,int>
{
public:
 typedef B::e_type e_type;
 virtual void x(void) { cout ?? "D::x" ?? endl; }
};

class D1: virtual public B?C?int>,int,int>,
          virtual public D
{
};


int main(void)
{
  B?C?int>,int,int> b;
  D x1;
  D x2;
  return 0;
}

than:
goblin:$ gcc t8.cc -lstdc++
Undefined                       first referenced
 symbol                             in file
EB?C?int>, int, int>::E?int> virtual table/usr/tmp/cca006xm1.o
a.out: fatal error: Symbol referencing errors. No output written to
a.out
collect2: ld returned 1 exit status
goblin:$




--

    @=
     //RSSH                              mailto:Ruslan@Shevchenko.Kiev.UA


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-04-06 17:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-06 17:35 virtual table referencing error Ruslan Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).