Argyrios Kyrtzidis | bbc6454 | 2010-08-15 01:15:20 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wunused %s |
| 2 | |
| 3 | static void f1(); // expected-warning{{unused}} |
| 4 | |
| 5 | namespace { |
| 6 | void f2(); // expected-warning{{unused}} |
| 7 | |
| 8 | void f3() { } // expected-warning{{unused}} |
| 9 | |
| 10 | struct S { |
| 11 | void m1() { } // expected-warning{{unused}} |
| 12 | void m2(); // expected-warning{{unused}} |
| 13 | void m3(); |
| 14 | }; |
| 15 | |
| 16 | template <typename T> |
| 17 | struct TS { |
| 18 | void m(); |
| 19 | }; |
| 20 | template <> void TS<int>::m() { } // expected-warning{{unused}} |
| 21 | |
| 22 | template <typename T> |
| 23 | void tf() { } |
| 24 | template <> void tf<int>() { } // expected-warning{{unused}} |
| 25 | |
| 26 | struct VS { |
| 27 | virtual void vm() { } |
| 28 | }; |
| 29 | |
| 30 | struct SVS : public VS { |
| 31 | void vm() { } |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | void S::m3() { } // expected-warning{{unused}} |
| 36 | |
| 37 | static inline void f4() { } |
| 38 | const unsigned int cx = 0; |
| 39 | |
| 40 | static int x1; // expected-warning{{unused}} |
| 41 | |
| 42 | namespace { |
| 43 | int x2; // expected-warning{{unused}} |
| 44 | |
| 45 | struct S2 { |
| 46 | static int x; // expected-warning{{unused}} |
| 47 | }; |
| 48 | |
| 49 | template <typename T> |
| 50 | struct TS2 { |
| 51 | static int x; |
| 52 | }; |
| 53 | template <> int TS2<int>::x; // expected-warning{{unused}} |
| 54 | } |