2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.benjamin / warn02.C
bloba2599aa1c941f55bec6c9c1e1fbce592bdcf234c
1 // { dg-do assemble  }
2 // { dg-options "-Wredundant-decls" }
3 // 980413 bkoz 
4 // from g++/15307, tests for -Wredundant-decls 
5 // for friend functions and functions 
8 extern int foo(const char *);
10 class A
12   friend int foo(const char *);
13   int a;
16 class B
18   friend int foo(const char *);
19   int foo2() {return b;}
20   int b;
23 class C
25   friend int foo(const char *);
26   friend int foo(const char *); // { dg-warning "" } 
27   int foo2() {return b;}
28   int b;
31 class D
33 public:
34   int foo2() {return b;}  
35   int foo2() {return b;}  // { dg-error "" } 
36   int b;
39 class E
41 public:
42   int foo2(); 
43   int foo2(); // { dg-error "" } 
44   int b;
47 extern int foo3(const char *);  // { dg-warning "" } 
48 extern int foo3(const char *);  // { dg-warning "" }