OSDN Git Service

compiler: Better error message if method requires pointer receiver.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Sep 2012 21:07:36 +0000 (21:07 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Sep 2012 21:07:36 +0000 (21:07 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191620 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/types.cc

index c4f8908..ebf2ed9 100644 (file)
@@ -6854,7 +6854,8 @@ Interface_type::implements_interface(const Type* t, std::string* reason) const
              std::string n = Gogo::message_name(p->name());
              size_t len = 100 + n.length();
              char* buf = new char[len];
-             snprintf(buf, len, _("method %s%s%s requires a pointer"),
+             snprintf(buf, len,
+                      _("method %s%s%s requires a pointer receiver"),
                       open_quote, n.c_str(), close_quote);
              reason->assign(buf);
              delete[] buf;
@@ -9043,7 +9044,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
                 Gogo::message_name(name).c_str(), ambig1.c_str(),
                 ambig2.c_str());
       else if (found_pointer_method)
-       error_at(location, "method requires a pointer");
+       error_at(location, "method requires a pointer receiver");
       else if (nt == NULL && st == NULL && it == NULL)
        error_at(location,
                 ("reference to field %qs in object which "