aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-09-21 21:07:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-09-21 21:07:24 +0000
commite152035846e82b5c247d0e40b19e46688a82efb3 (patch)
treef6df636a7ee31905949a14f3c9a3571907d060fb /gcc
parent74adb444f9795fe759ccc36294de9f1c0d6b3e9e (diff)
downloadgcc-e152035846e82b5c247d0e40b19e46688a82efb3.zip
gcc-e152035846e82b5c247d0e40b19e46688a82efb3.tar.gz
gcc-e152035846e82b5c247d0e40b19e46688a82efb3.tar.bz2
compiler: Better error message if method requires pointer receiver.
From-SVN: r191619
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/types.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 5c210cb..16ff750 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -6845,7 +6845,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;
@@ -9034,7 +9035,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 "