]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/59295 (useless warning: 'Bar' is already a friend of 'Foo' [enabled by...
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Wed, 16 Apr 2014 17:39:45 +0000 (10:39 -0700)
committerPaul Pluzhnikov <ppluzhnikov@gcc.gnu.org>
Wed, 16 Apr 2014 17:39:45 +0000 (10:39 -0700)
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

gcc/cp/ChangeLog
gcc/cp/friend.c

index 4a50a2db39a2375d43485283ac6f61bf36deacb8..f9206e86f334dc7ccf79e7aa87cf9b5a53f3497b 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2014-04-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
index 150b392b62a3e5d982c0cbd61589cf8f39895ac4..a30918c0006986149dd6eb4445f5ee2e403935ad 100644 (file)
@@ -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;
            }
        }
This page took 0.066931 seconds and 5 git commands to generate.