blob: d2d48d1c78db7cc3cc8ef4fa714c863b9548024a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// { dg-do run }
class base {
public:
virtual ~base() {}
virtual void m1() = 0;
virtual void m2() = 0;
};
class intermediate : public virtual base {
public:
virtual ~intermediate() {}
virtual void m1() {}
virtual void m2() {}
};
class derived : public intermediate {
public:
virtual int IwantedThisMethod() { return 0; }
virtual int ButIgotThisOne() { return 1; }
};
int main() {
return derived().IwantedThisMethod();
}
|