Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/inherit/covariant1.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/5607 // { dg-do run } class A { public: virtual A* getThis() { return this; } }; class B { int a; public: virtual B* getThis() { return this; } }; class AB : public A, public B { public: virtual AB* getThis() { return this; } }; int main () { AB* ab = new AB(); A* a = ab; B* b = ab; if (a->getThis() != a || b->getThis() != b) return 1; return 0; }