aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>1998-04-21 19:45:53 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>1998-04-21 19:45:53 +0000
commit1c2c795e9785b1db097d9d7c656d62e75f785c56 (patch)
tree82ff4a13cb9f693c8cb73c1594bf239feb655634 /gcc
parenta147412ac137e60a3e2fe2a5bea6d4af04068199 (diff)
downloadgcc-1c2c795e9785b1db097d9d7c656d62e75f785c56.zip
gcc-1c2c795e9785b1db097d9d7c656d62e75f785c56.tar.gz
gcc-1c2c795e9785b1db097d9d7c656d62e75f785c56.tar.bz2
*** empty log message ***
From-SVN: r19366
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C54
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C b/gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C
new file mode 100644
index 0000000..a60a2d7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C
@@ -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 -
+
+
+
+
+
+