URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.benjamin/] [warn02.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do assemble }
// { dg-options "-Wredundant-decls" }
// 980413 bkoz
// from g++/15307, tests for -Wredundant-decls
// for friend functions and functions
extern int foo(const char *);
class A
{
friend int foo(const char *);
int a;
};
class B
{
friend int foo(const char *);
int foo2() {return b;}
int b;
};
class C
{
friend int foo(const char *);
friend int foo(const char *); // { dg-warning "" }
int foo2() {return b;}
int b;
};
class D
{
public:
int foo2() {return b;} // { dg-error "with" }
int foo2() {return b;} // { dg-error "overloaded" }
int b;
};
class E
{
public:
int foo2(); // { dg-error "with" }
int foo2(); // { dg-error "overloaded" }
int b;
};
extern int foo3(const char *); // { dg-warning "" }
extern int foo3(const char *); // { dg-warning "" }