blob: d5662d3f6313c9d9fa9b74fcf168da22073c978f [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 %s -verify -fsyntax-only
2class A {
3 void f() __attribute__((deprecated));
4 void g(A* a);
5 void h(A* a) __attribute__((deprecated));
6
7 int b __attribute__((deprecated));
8};
9
10void A::g(A* a)
11{
12 f(); // expected-warning{{'f' is deprecated}}
13 a->f(); // expected-warning{{'f' is deprecated}}
14
15 (void)b; // expected-warning{{'b' is deprecated}}
16 (void)a->b; // expected-warning{{'b' is deprecated}}
17}
18
19void A::h(A* a)
20{
21 f();
22 a->f();
23
24 (void)b;
25 (void)a->b;
26}
27
28struct B {
29 virtual void f() __attribute__((deprecated));
30 void g();
31};
32
33void B::g() {
34 f();
35 B::f(); // expected-warning{{'f' is deprecated}}
36}
37
38struct C : B {
39 virtual void f();
40 void g();
41};
42
43void C::g() {
44 f();
45 C::f();
46 B::f(); // expected-warning{{'f' is deprecated}}
47}
48
49void f(B* b, C *c) {
50 b->f();
51 b->B::f(); // expected-warning{{'f' is deprecated}}
52
53 c->f();
54 c->C::f();
55 c->B::f(); // expected-warning{{'f' is deprecated}}
56}
57
58struct D {
59 virtual void f() __attribute__((deprecated));
60};
61
62void D::f() { }
63
64void f(D* d) {
65 d->f();
66}