From: Paul Pluzhnikov Date: Wed, 16 Apr 2014 17:39:45 +0000 (-0700) Subject: re PR c++/59295 (useless warning: 'Bar' is already a friend of 'Foo' [enabled by... X-Git-Tag: releases/gcc-5.1.0~8087 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b0af0aa08c3253e8a058f940e398c8fbb10be1;p=thirdparty%2Fgcc.git re PR c++/59295 (useless warning: 'Bar' is already a friend of 'Foo' [enabled by default]) 2014-04-16 Paul Pluzhnikov PR c++/59295 * friend.c (add_friend, make_friend_class): Move repeated friend warning under Wredundant_decls. From-SVN: r209444 --- 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; } }