warn-unused-filescoped.cpp revision 3d27b107c515ab1a8fd47b33c41adcf5a65f465b
1// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-method %s 2 3static void f1(); // expected-warning{{unused}} 4 5namespace { 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 S(const S&); 15 void operator=(const S&); 16 }; 17 18 template <typename T> 19 struct TS { 20 void m(); 21 }; 22 template <> void TS<int>::m() { } // expected-warning{{unused}} 23 24 template <typename T> 25 void tf() { } 26 template <> void tf<int>() { } // expected-warning{{unused}} 27 28 struct VS { 29 virtual void vm() { } 30 }; 31 32 struct SVS : public VS { 33 void vm() { } 34 }; 35} 36 37void S::m3() { } // expected-warning{{unused}} 38 39static inline void f4() { } 40const unsigned int cx = 0; 41 42static int x1; // expected-warning{{unused}} 43 44namespace { 45 int x2; // expected-warning{{unused}} 46 47 struct S2 { 48 static int x; // expected-warning{{unused}} 49 }; 50 51 template <typename T> 52 struct TS2 { 53 static int x; 54 }; 55 template <> int TS2<int>::x; // expected-warning{{unused}} 56} 57