| 1 |
// PR c++/109918 - More tests with multiple inheritance |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-additional-options -Woverloaded-virtual } |
| 4 |
|
| 5 |
struct Troops { virtual ~Troops(); }; |
| 6 |
struct Control { |
| 7 |
virtual int GetControl() const { return 42; } // { dg-warning "was hidden" } |
| 8 |
}; |
| 9 |
struct Army : Troops, Control { |
| 10 |
template<class T> void GetControl() const; // { dg-message "by" } |
| 11 |
}; |
| 12 |
|
| 13 |
|
| 14 |
struct A { |
| 15 |
virtual void get() const; |
| 16 |
}; |
| 17 |
struct B { |
| 18 |
virtual void get() const; |
| 19 |
virtual void get(char) const; // { dg-warning "was hidden" } |
| 20 |
}; |
| 21 |
|
| 22 |
struct C : A, B { |
| 23 |
virtual void get() const; // { dg-message "by" } |
| 24 |
virtual void get(int) const; |
| 25 |
}; |