Suppress warning about duplicate decls if the first decl is a friend.
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 May 2001 17:09:34 +0000 (17:09 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 May 2001 17:09:34 +0000 (17:09 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42073 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/decl.c

index edc4849..9bd83c1 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-14  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * decl.c (duplicate_decls): Suppress warning about duplicate
+        decls if the first decl is a friend.
+
 Mon May 14 17:34:48 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.h (TARGET_64BIT): Define to constant if !TARGET_BI_ARCH
index 54d84f4..ee5c279 100644 (file)
@@ -3457,7 +3457,7 @@ duplicate_decls (newdecl, olddecl)
          /* Don't warn about extern decl followed by definition. */
          && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
          /* Don't warn about friends, let add_friend take care of it. */
-         && ! DECL_FRIEND_P (newdecl))
+         && ! (DECL_FRIEND_P (newdecl) || DECL_FRIEND_P (olddecl)))
        {
          cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
          cp_warning_at ("previous declaration of `%D'", olddecl);