aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-09-03 04:33:32 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-09-03 04:33:32 +0000
commitfc253334957be7816edb209dcc25907c624a02f0 (patch)
tree8a1955554b8d05c49f22967b8cf87ce57a206688 /gcc/go
parent5b07801722820463b96536be47939b0dfd641655 (diff)
downloadgcc-fc253334957be7816edb209dcc25907c624a02f0.zip
gcc-fc253334957be7816edb209dcc25907c624a02f0.tar.gz
gcc-fc253334957be7816edb209dcc25907c624a02f0.tar.bz2
compiler: Report invalid receiver types in function definitions.
Fixes golang/go#12324. Reviewed-on: https://go-review.googlesource.com/13988 From-SVN: r227427
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/gogo.cc6
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index f74d2ca..9dea1f8 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-3f8feb4f905535448833a14e4f5c83f682087749
+672ac2abc52d8bd70cb9fb03dd4a32fdde9c438f
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 233ee27..5ecc55d 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -1818,7 +1818,11 @@ Gogo::start_function(const std::string& name, Function_type* type,
function);
}
else
- go_unreachable();
+ {
+ error_at(type->receiver()->location(),
+ "invalid receiver type (receiver must be a named type)");
+ ret = Named_object::make_function(name, NULL, function);
+ }
}
this->package_->bindings()->add_method(ret);
}