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:
parent
509933ca56
commit
2b0d13bfd6
|
@ -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}}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue