diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4a50a2db39a2..f9206e86f334 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-04-16 Paul Pluzhnikov + + PR c++/59295 + * friend.c (add_friend, make_friend_class): Move repeated friend + warning under Wredundant_decls. + 2014-04-15 Paolo Carlini * decl.c (duplicate_decls): Remove redundant TYPE_NAME use. diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 150b392b62a3..a30918c00069 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -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; } }