1 // RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function %s
3 static void f1(); // expected-warning{{unused}}
6 void f2(); // expected-warning{{unused}}
8 void f3() { } // expected-warning{{unused}}
11 void m1() { } // expected-warning{{unused}}
12 void m2(); // expected-warning{{unused}}
15 void operator=(const S&);
22 template <> void TS<int>::m() { } // expected-warning{{unused}}
26 template <> void tf<int>() { } // expected-warning{{unused}}
32 struct SVS : public VS {
37 void S::m3() { } // expected-warning{{unused}}
39 static inline void f4() { }
40 const unsigned int cx = 0;
42 static int x1; // expected-warning{{unused}}
45 int x2; // expected-warning{{unused}}
48 static int x; // expected-warning{{unused}}
55 template <> int TS2<int>::x; // expected-warning{{unused}}
59 // Ensure that friends of class templates are considered to have a dependent
60 // context and not marked unused.
62 template <typename T> struct X {
63 friend bool operator==(const X&, const X&) { return false; }
66 template <typename T> void template_test(X<T> x) {
76 namespace { struct A {}; }
78 void test(A a); // expected-warning {{unused function}}
79 extern "C" void test4(A a);
82 namespace rdar8733476 {
83 static void foo() { } // expected-warning {{not needed and will not be emitted}}