summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/friend.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/friend.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/friend.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/friend.C b/gcc/testsuite/g++.dg/warn/friend.C
new file mode 100644
index 000000000..e7982896a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/friend.C
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options -Wredundant-decls } */
+
+/* Test to see if spurious warnings about redundant
+ declarations are emiited because of the friend
+ declaration. */
+
+class Foo
+{
+ friend void bar (Foo);
+public:
+};
+
+extern void bar (Foo);