Commit 23b0af0a by Paul Pluzhnikov Committed by Paul Pluzhnikov

re PR c++/59295 (useless warning: 'Bar' is already a friend of 'Foo' [enabled by default])

2014-04-16  Paul Pluzhnikov  <ppluzhnikov@google.com>

	PR c++/59295
	* friend.c (add_friend, make_friend_class): Move repeated friend
	warning under Wredundant_decls.

From-SVN: r209444
parent 61c7fb30
2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
PR c++/59295
* friend.c (add_friend, make_friend_class): Move repeated friend
warning under Wredundant_decls.
2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
......
......@@ -148,7 +148,8 @@ add_friend (tree type, tree decl, bool complain)
if (decl == TREE_VALUE (friends))
{
if (complain)
warning (0, "%qD is already a friend of class %qT",
warning (OPT_Wredundant_decls,
"%qD is already a friend of class %qT",
decl, type);
return;
}
......@@ -376,7 +377,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
if (friend_type == probe)
{
if (complain)
warning (0, "%qD is already a friend of %qT", probe, type);
warning (OPT_Wredundant_decls,
"%qD is already a friend of %qT", probe, type);
break;
}
}
......@@ -385,7 +387,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
if (same_type_p (probe, friend_type))
{
if (complain)
warning (0, "%qT is already a friend of %qT", probe, type);
warning (OPT_Wredundant_decls,
"%qT is already a friend of %qT", probe, type);
break;
}
}
......
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