Shih-wei Liao | f8fd82b | 2010-02-10 11:10:31 -0800 | [diff] [blame^] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only |
| 2 | class 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 | |
| 10 | void 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 | |
| 19 | void A::h(A* a) |
| 20 | { |
| 21 | f(); |
| 22 | a->f(); |
| 23 | |
| 24 | (void)b; |
| 25 | (void)a->b; |
| 26 | } |
| 27 | |
| 28 | struct B { |
| 29 | virtual void f() __attribute__((deprecated)); |
| 30 | void g(); |
| 31 | }; |
| 32 | |
| 33 | void B::g() { |
| 34 | f(); |
| 35 | B::f(); // expected-warning{{'f' is deprecated}} |
| 36 | } |
| 37 | |
| 38 | struct C : B { |
| 39 | virtual void f(); |
| 40 | void g(); |
| 41 | }; |
| 42 | |
| 43 | void C::g() { |
| 44 | f(); |
| 45 | C::f(); |
| 46 | B::f(); // expected-warning{{'f' is deprecated}} |
| 47 | } |
| 48 | |
| 49 | void 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 | |
| 58 | struct D { |
| 59 | virtual void f() __attribute__((deprecated)); |
| 60 | }; |
| 61 | |
| 62 | void D::f() { } |
| 63 | |
| 64 | void f(D* d) { |
| 65 | d->f(); |
| 66 | } |