aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/friend.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-04-16 10:39:45 -0700
committerPaul Pluzhnikov <ppluzhnikov@gcc.gnu.org>2014-04-16 10:39:45 -0700
commit23b0af0aa08c3253e8a058f940e398c8fbb10be1 (patch)
treea1129143dad7d1199aa46293019c3794ec4c6aed /gcc/cp/friend.c
parent61c7fb308a746e03d3ae8ba54234a8e18b2479da (diff)
downloadgcc-23b0af0aa08c3253e8a058f940e398c8fbb10be1.zip
gcc-23b0af0aa08c3253e8a058f940e398c8fbb10be1.tar.gz
gcc-23b0af0aa08c3253e8a058f940e398c8fbb10be1.tar.bz2
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
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r--gcc/cp/friend.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 150b392..a30918c 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;
}
}