1 // RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
2
3 namespace test1 {
f()4 static void f() {} // expected-warning {{function 'f' is not needed and will not be emitted}}
5 static void f();
6 template <typename T>
foo()7 void foo() {
8 f();
9 }
10 }
11
12 namespace test1_template {
f()13 template <typename T> static void f() {}
f()14 template <> void f<int>() {} // expected-warning {{function 'f<int>' is not needed and will not be emitted}}
15 template <typename T>
foo()16 void foo() {
17 f<int>();
18 f<long>();
19 }
20 } // namespace test1_template
21
22 namespace test2 {
f()23 static void f() {}
24 static void f();
g()25 static void g() { f(); }
h()26 void h() { g(); }
27 }
28
29 namespace test3 {
30 static void f();
31 template<typename T>
g()32 static void g() {
33 f();
34 }
f()35 static void f() {
36 }
h()37 void h() {
38 g<int>();
39 }
40 }
41
42 namespace test4 {
43 static void f();
44 static void f();
45 template<typename T>
g()46 static void g() {
47 f();
48 }
f()49 static void f() {
50 }
h()51 void h() {
52 g<int>();
53 }
54 }
55
56 namespace test4 {
57 static void func();
bar()58 void bar() {
59 void func();
60 func();
61 }
func()62 static void func() {}
63 }
64