From 556ffb6757a5bdcb8ad49656214c2e74a63d619b Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Mon, 13 Apr 1998 11:13:36 +0000 Subject: [PATCH] decl.c (duplicate_decls): Don't warn for redundant decls if friend: let add_friend take care of it. x Fri Apr 10 12:16:49 1998 Benjamin Kosnik * 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a71a768ceda..cb2b0059675 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); -- 2.30.2