mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-07 22:37:44 +08:00
*** empty log message ***
From-SVN: r19366
This commit is contained in:
parent
a147412ac1
commit
1c2c795e97
54
gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C
Normal file
54
gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C
Normal file
@ -0,0 +1,54 @@
|
||||
// 980413 bkoz
|
||||
// from g++/15307, tests for -Wredundant-decls
|
||||
// for friend functions and functions
|
||||
// Build don't link:
|
||||
//Special g++ Options: -Wredundant-decls
|
||||
|
||||
|
||||
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 *); // WARNING -
|
||||
int foo2() {return b;}
|
||||
int b;
|
||||
};
|
||||
|
||||
class D
|
||||
{
|
||||
public:
|
||||
int foo2() {return b;} // WARNING -
|
||||
int foo2() {return b;} // WARNING -
|
||||
int b;
|
||||
};
|
||||
|
||||
class E
|
||||
{
|
||||
public:
|
||||
int foo2(); // WARNING -
|
||||
int foo2(); // WARNING -
|
||||
int b;
|
||||
};
|
||||
|
||||
extern int foo3(const char *); // WARNING -
|
||||
extern int foo3(const char *); // WARNING -
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user