2 // { dg-options "-Wredundant-decls" }
4 // from g++/15307, tests for -Wredundant-decls
5 // for friend functions and functions
8 extern int foo(const char *);
12 friend int foo(const char *);
18 friend int foo(const char *);
19 int foo2() {return b;}
25 friend int foo(const char *);
26 friend int foo(const char *); // { dg-warning "" }
27 int foo2() {return b;}
34 int foo2() {return b;} // { dg-message "previous" }
35 int foo2() {return b;} // { dg-error "overloaded" }
42 int foo2(); // { dg-message "previous" }
43 int foo2(); // { dg-error "overloaded" }
47 extern int foo3(const char *); // { dg-message "" }
48 extern int foo3(const char *); // { dg-warning "" }