This is the mail archive of the gcc-bugs@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 test case...


Hiya,

I posted this one before, can someone PLEASE add this
test case too?  I see lots of tests being added since
last time I posted this one and I really don't see what
is wrong/different with my test case.

Of course, just fixing the bug in egcs would make me
happy too - I can't :(.  I'd like to, but I have no
idea where to start.  If someone could give me a clue
where to look and what to do to start looking for this
bug, please mail me.

I didn't get further than finding that in the .s file
a reference to a virtual table is generated, but not the
virtual table itself.

>ls -l virtual2.s
-rw-r-----   1 root     root         2685 Jul 13 18:42 virtual2.s
>grep -A3 -B3 '1DZ1C' virtual2.s
.LCFI5:
        leal -4(%ebp),%eax
        movl %eax,-8(%ebp)
        movl $__vt_t1A2Z1DZ1C.1V,-4(%ebp)
        movl %ebp,%esp
        popl %ebp
        ret

Note that this is a pretty complex bug, involving two templates
one of which has a virtual function, a virtual base class with
a virtual table, and a typedef.  I believe it is not possible to
simplify this test case any further without that it DOES compile
(ie, when removing any 'virtual', short circuiting the typedef or
 trying to get rid of one of the templates, results in it compiling
 and linking just fine).

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>


*** /dev/null	Tue Jan  1 05:00:00 1980
--- gcc/testsuite/g++.old-deja/g++.other/virtual2.C	Sat Jul  4 16:18:34 1998
***************
*** 0 ****
--- 1,30 ----
+ // Build don't run:
+ // Causes "undefined reference to `A<D, C>::V virtual table'"
+ 
+ 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]