OSDN Git Service

* call.c (struct z_candidate): Add explicit_targs field.
[pf3gnuchains/gcc-fork.git] / gcc / cp / friend.c
index 96c6dc6..03748fe 100644 (file)
@@ -59,15 +59,15 @@ is_friend (tree type, tree supplicant)
              tree friends = FRIEND_DECLS (list);
              for (; friends ; friends = TREE_CHAIN (friends))
                {
-                 tree friend = TREE_VALUE (friends);
+                 tree this_friend = TREE_VALUE (friends);
 
-                 if (friend == NULL_TREE)
+                 if (this_friend == NULL_TREE)
                    continue;
 
-                 if (supplicant == friend)
+                 if (supplicant == this_friend)
                    return 1;
 
-                 if (is_specialization_of_friend (supplicant, friend))
+                 if (is_specialization_of_friend (supplicant, this_friend))
                    return 1;
                }
              break;
@@ -568,11 +568,13 @@ do_friend (tree ctype, tree declarator, tree decl,
          if (warn)
            {
              static int explained;
-             warning (OPT_Wnon_template_friend, "friend declaration "
-                      "%q#D declares a non-template function", decl);
-             if (! explained)
+             bool warned;
+
+             warned = warning (OPT_Wnon_template_friend, "friend declaration "
+                               "%q#D declares a non-template function", decl);
+             if (! explained && warned)
                {
-                 inform ("(if this is not what you intended, make sure "
+                 inform (input_location, "(if this is not what you intended, make sure "
                          "the function template has already been declared "
                          "and add <> after the function name here) ");
                  explained = 1;