Commit 556ffb67 by Benjamin Kosnik

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  <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
parent d74ce43a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment