This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR59295 -- move redundant friend decl warning under -Wredundant-decls
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: ppluzhnikov at google dot com, Fabien ChÃÂne <fabien dot chene at gmail dot com>, drheld at google dot com
- Date: Fri, 11 Apr 2014 09:20:13 -0700
- Subject: Re: [patch] Fix PR59295 -- move redundant friend decl warning under -Wredundant-decls
- Authentication-results: sourceware.org; auth=none
- References: <ye6qk3bn7ci8 dot fsf at elbrus2 dot mtv dot corp dot google dot com>
Ping?
On Fri, Mar 21, 2014 at 9:16 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Greetings,
>
> To fix PR59295, this patch moves (generally useless) warning about
> repeated / redundant friend declarations under -Wredundant-decls.
>
> Tested on Linux/x86_64 with no regressions.
>
> Ok for trunk once it opens in stage 1?
Which has just happened.
>
> Thanks,
>
> --
>
> 2014-03-21 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> PR c++/59295
> * gcc/cp/friend.c (add_friend, make_friend_class): Move repeated
> friend warning under Wredundant_decls.
>
> Index: gcc/cp/friend.c
> ===================================================================
> --- gcc/cp/friend.c (revision 208748)
> +++ gcc/cp/friend.c (working copy)
> @@ -148,7 +148,8 @@
> 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 @@
> 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 @@
> 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;
> }
> }
--
Paul Pluzhnikov