From: ian Date: Thu, 3 Sep 2015 04:33:32 +0000 (+0000) Subject: compiler: Report invalid receiver types in function definitions. X-Git-Tag: upstream/6.1~4914 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45cdc508f7224ba9bc713ab8ecee621106f7ab3a;p=platform%2Fupstream%2Flinaro-gcc.git compiler: Report invalid receiver types in function definitions. Fixes golang/go#12324. Reviewed-on: https://go-review.googlesource.com/13988 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227427 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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); }