Add test to verify we emit warning when the deprecated virtual function is overloaded.

Suggested by Richard Smith.

llvm-svn: 242980
This commit is contained in:
Davide Italiano 2015-07-23 02:54:59 +00:00
parent 509933ca56
commit 2b0d13bfd6
1 changed files with 6 additions and 0 deletions

View File

@ -57,12 +57,18 @@ void f(B* b, C *c) {
struct D {
virtual void f() __attribute__((deprecated));
virtual void f(int) __attribute__((deprecated));
virtual void f(int, int) __attribute__((deprecated));
};
void D::f() { } // expected-note{{'f' has been explicitly marked deprecated here}}
void D::f(int v) { } // expected-note{{'f' has been explicitly marked deprecated here}}
void D::f(int v1, int v2) { } // expected-note{{'f' has been explicitly marked deprecated here}}
void f(D* d) {
d->f(); // expected-warning{{'f' is deprecated}}
d->f(42); // expected-warning{{'f' is deprecated}}
d->f(42, 24); // expected-warning{{'f' is deprecated}}
}