decl.c (duplicate_decls): Don't warn for redundant decls if friend: let add_friend...
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Mon, 13 Apr 1998 11:13:36 +0000 (11:13 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Mon, 13 Apr 1998 11:13:36 +0000 (11:13 +0000)
x
Fri Apr 10 12:16:49 1998  Benjamin Kosnik  <bkoz@loony.cygnus.com>
* decl.c (duplicate_decls): Don't warn for redundant decls if
  friend: let add_friend take care of it.
Fixes g++/15307

From-SVN: r19198

gcc/cp/decl.c

index a71a768ceda37394eb4bca8db569193555579df1..cb2b00596752cad61fd63f87acfa2b3261978bed 100644 (file)
@@ -2786,7 +2786,9 @@ duplicate_decls (newdecl, olddecl)
       && ! DECL_ARTIFICIAL (olddecl)
       && !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE)
       /* Don't warn about extern decl followed by (tentative) definition.  */
-      && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl)))
+      && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
+      /* Don't warn about friends, let add_friend take care of it. */
+      && ! DECL_FRIEND_P (newdecl))
     {
       cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
       cp_warning_at ("previous declaration of `%D'", olddecl);