decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 21 Apr 1998 19:08:46 +0000 (19:08 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 21 Apr 1998 19:08:46 +0000 (19:08 +0000)
8
* decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
g++/15307 redux

From-SVN: r19362

gcc/cp/decl.c

index 164d7068613f4bf5bcf8c5d0f4b3296c27debbc8..890c9f5fd7c874f3aaf7027adf63fa4770c87474 100644 (file)
@@ -2794,7 +2794,7 @@ duplicate_decls (newdecl, olddecl)
       /* Don't warn about extern decl followed by (tentative) definition.  */
       && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
       /* Don't warn about friends, let add_friend take care of it. */
-      && ! DECL_FRIEND_P (newdecl))
+      && (TREE_CODE (newdecl) == FUNCTION_DECL && ! DECL_FRIEND_P (newdecl)))
     {
       cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
       cp_warning_at ("previous declaration of `%D'", olddecl);