PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wmissing-declarations-1.C
blob8944325190070ff1157530ce2d222398f5422d76
1 // { dg-options "-Wmissing-declarations" }
3 void fn1() { }          // { dg-warning "no previous declaration" }
4 namespace ns {
5   void fn2() { }        // { dg-warning "no previous declaration" }
7 namespace {
8   void fn3() { }
10 static void fn4() { }
12 void fn5();
13 namespace ns {
14   void fn6();
17 void fn5() { }
18 namespace ns {
19   void fn6() { }
22 inline void fn7() { }
24 class c {
25   void cfn1() { }
26   static void cfn2() { }
27   void cfn3();
28   static void cfn4();
31 void c::cfn3() { }
32 void c::cfn4() { }
34 static struct {
35   void sfn1() { }
36   static void sfn2() { }
37 } s;
39 template<typename C>
40 void tfn1() { }
42 template void tfn1<c>();
44 class d { };
45 template<> void tfn1<d>() { }