From: Benjamin Kosnik Date: Mon, 13 Apr 1998 11:13:36 +0000 (+0000) Subject: decl.c (duplicate_decls): Don't warn for redundant decls if friend: let add_friend... X-Git-Tag: prereleases/egcs-1.1-prerelease~1719 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=556ffb6757a5bdcb8ad49656214c2e74a63d619b;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a71a768ceda3..cb2b00596752 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);