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?

Thanks,

--

2014-03-21  Paul Pluzhnikov  <ppluzhni...@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;
            }
        }

Reply via email to