Argyrios Kyrtzidis | 799ef66 | 2011-02-03 18:01:15 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -Woverloaded-virtual -verify %s |
| 2 | |
| 3 | struct B1 { |
| 4 | virtual void foo(int); // expected-note {{declared here}} |
| 5 | virtual void foo(); // expected-note {{declared here}} |
| 6 | }; |
| 7 | |
| 8 | struct S1 : public B1 { |
| 9 | void foo(float); // expected-warning {{hides overloaded virtual functions}} |
| 10 | }; |
| 11 | |
| 12 | struct S2 : public B1 { |
| 13 | void foo(); // expected-note {{declared here}} |
| 14 | }; |
| 15 | |
| 16 | struct B2 { |
| 17 | virtual void foo(void*); // expected-note {{declared here}} |
| 18 | }; |
| 19 | |
| 20 | struct MS1 : public S2, public B2 { |
| 21 | virtual void foo(int); // expected-warning {{hides overloaded virtual functions}} |
| 22 | }; |
| 23 | |
| 24 | struct B3 { |
| 25 | virtual void foo(int); |
| 26 | virtual void foo(); |
| 27 | }; |
| 28 | |
| 29 | struct S3 : public B3 { |
| 30 | using B3::foo; |
| 31 | void foo(float); |
| 32 | }; |
| 33 | |
| 34 | struct B4 { |
| 35 | virtual void foo(); |
| 36 | }; |
| 37 | |
| 38 | struct S4 : public B4 { |
| 39 | void foo(float); |
| 40 | void foo(); |
| 41 | }; |