diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-30 15:57:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-30 15:57:46 +0000 |
commit | 284fdc4c1595dba3140d29c453f4966d3e97dfd5 (patch) | |
tree | e9a01f545dbd4b0efd7b1c180809a4243b5f8ba2 | |
parent | 8ff7780cb292144ad27af13ab18f873fcd731786 (diff) | |
download | gcc-284fdc4c1595dba3140d29c453f4966d3e97dfd5.zip gcc-284fdc4c1595dba3140d29c453f4966d3e97dfd5.tar.gz gcc-284fdc4c1595dba3140d29c453f4966d3e97dfd5.tar.bz2 |
compiler: support alias to pointer type as method receiver
Fixes golang/go#28252.
Reviewed-on: https://go-review.googlesource.com/c/160077
From-SVN: r268397
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 10e20ce..c9d68e1 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -5af8ee0693944c280b1f529450dbfd4ec1ee451d +2206f40fc1e0e1e2ba3eacb7388dd26b72729bde 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 d0d6f3b..b03051c 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -1944,6 +1944,10 @@ Gogo::start_function(const std::string& name, Function_type* type, go_assert(at_top_level); Type* rtype = type->receiver()->type(); + while (rtype->named_type() != NULL + && rtype->named_type()->is_alias()) + rtype = rtype->named_type()->real_type()->forwarded(); + // We want to look through the pointer created by the // parser, without getting an error if the type is not yet // defined. |