This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] Suppress warning about redundant decl when first decl is a friend.


Hi Geoff,

> Can you add a testcase too?

Certainly.  I will check in the test below.

Cheers
        Nick


2001-05-15  Nick Clifton  <nickc@cambridge.redhat.com>

	* g++.dg/friend-warn.C: New test.  Do not warn about friend
	declaration being redundant.

Index: testsuite/g++.dg/friend-warn.C
===================================================================
RCS file: friend-warn.C
diff -N friend-warn.C
*** /dev/null	Tue May  5 13:32:27 1998
--- friend-warn.C	Tue May 15 00:53:35 2001
***************
*** 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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]