3 // Copyright (C) 2005 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 11 Feb 2005 <nathan@codesourcery.com>
6 // Origin: bredelin@ucla.edu
7 // Bug 19891: Incorrect covariant vtables
11 virtual Model* clone() const =0;
12 virtual const char *name() const =0;
16 struct R: virtual public Model {
17 virtual R* clone() const =0;
19 struct A: virtual public Model {
20 virtual A* clone() const=0;
22 struct RA: public R, public A {
23 virtual RA* clone() const=0;
26 static const char *string = "EQU";
28 struct EQU: public RA {
29 virtual EQU* clone() const {return new EQU(*this);}
30 const char *name() const {return string;}
34 Model* M1 = new EQU();
35 Model* M2 = M1->clone();
36 Model* M3 = M2->clone();
38 if (M1->name () != string)
40 if (M2->name () != string)
42 if (M3->name () != string)