2009-08-09 00:55:18 +08:00
|
|
|
// RUN: clang-cc %s -verify -fsyntax-only
|
|
|
|
class A {
|
|
|
|
void f() __attribute__((deprecated));
|
|
|
|
void g(A* a);
|
2009-08-09 01:48:49 +08:00
|
|
|
void h(A* a) __attribute__((deprecated));
|
2009-08-09 00:55:18 +08:00
|
|
|
|
|
|
|
int b __attribute__((deprecated));
|
|
|
|
};
|
|
|
|
|
|
|
|
void A::g(A* a)
|
|
|
|
{
|
|
|
|
f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
a->f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
|
|
|
|
(void)b; // expected-warning{{'b' is deprecated}}
|
|
|
|
(void)a->b; // expected-warning{{'b' is deprecated}}
|
|
|
|
}
|
2009-08-09 01:48:49 +08:00
|
|
|
|
|
|
|
void A::h(A* a)
|
|
|
|
{
|
|
|
|
f();
|
|
|
|
a->f();
|
|
|
|
|
|
|
|
(void)b;
|
|
|
|
(void)a->b;
|
|
|
|
}
|
2009-09-11 04:48:14 +08:00
|
|
|
|
|
|
|
struct B {
|
|
|
|
virtual void f() __attribute__((deprecated));
|
2009-09-11 13:54:14 +08:00
|
|
|
void g();
|
2009-09-11 04:48:14 +08:00
|
|
|
};
|
|
|
|
|
2009-09-11 13:54:14 +08:00
|
|
|
void B::g() {
|
|
|
|
f();
|
|
|
|
B::f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
}
|
|
|
|
|
2009-09-11 04:48:14 +08:00
|
|
|
struct C : B {
|
|
|
|
virtual void f();
|
2009-09-11 13:54:14 +08:00
|
|
|
void g();
|
2009-09-11 04:48:14 +08:00
|
|
|
};
|
|
|
|
|
2009-09-11 13:54:14 +08:00
|
|
|
void C::g() {
|
|
|
|
f();
|
|
|
|
C::f();
|
|
|
|
B::f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
}
|
|
|
|
|
2009-09-11 04:48:14 +08:00
|
|
|
void f(B* b, C *c) {
|
|
|
|
b->f();
|
|
|
|
b->B::f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
|
|
|
|
c->f();
|
|
|
|
c->C::f();
|
|
|
|
c->B::f(); // expected-warning{{'f' is deprecated}}
|
|
|
|
}
|
2009-09-14 05:01:57 +08:00
|
|
|
|
|
|
|
struct D {
|
|
|
|
virtual void f() __attribute__((deprecated));
|
|
|
|
};
|
|
|
|
|
|
|
|
void D::f() { }
|
|
|
|
|
|
|
|
void f(D* d) {
|
|
|
|
d->f();
|
|
|
|
}
|