Commit 70233af3 by Benjamin Kosnik

decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.

8
* decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
g++/15307 redux

From-SVN: r19362
parent dbf51904
...@@ -2794,7 +2794,7 @@ duplicate_decls (newdecl, olddecl) ...@@ -2794,7 +2794,7 @@ duplicate_decls (newdecl, olddecl)
/* Don't warn about extern decl followed by (tentative) definition. */ /* 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. */ /* 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 ("redundant redeclaration of `%D' in same scope", newdecl);
cp_warning_at ("previous declaration of `%D'", olddecl); 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