public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
To: egcs@cygnus.com
Subject: virtual table referencing error.
Date: Mon, 06 Apr 1998 17:35:00 -0000	[thread overview]
Message-ID: <35293082.2D0527D1@Shevchenko.Kiev.UA> (raw)

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


                 reply	other threads:[~1998-04-06 17:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35293082.2D0527D1@Shevchenko.Kiev.UA \
    --to=ruslan@shevchenko.kiev.ua \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).