diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-02-01 14:44:20 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-02-04 16:44:43 -0800 |
commit | b523cae81c64c3557f3918ce01419242c4238009 (patch) | |
tree | a94a1b0cd79853c7cac705350cbd046fd5ea2725 /gcc/go | |
parent | 3c1cbde16e523edcd8b91835eab2ad3e2672a9fa (diff) | |
download | gcc-b523cae81c64c3557f3918ce01419242c4238009.zip gcc-b523cae81c64c3557f3918ce01419242c4238009.tar.gz gcc-b523cae81c64c3557f3918ce01419242c4238009.tar.bz2 |
compiler: accept "any" as an alias for "interface{}"
For golang/go#33232
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/382248
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a42d88d..f78561c 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -7d510bf5fcec9b0ccc0282f4193a80c0a164df63 +61f7cf4b9db0587ff099aa36832a355b90ee1bf9 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 e2fd509..b1e210e 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -141,6 +141,15 @@ Gogo::Gogo(Backend* backend, Linemap* linemap, int, int pointer_size) this->add_named_type(error_type); } + // "any" is an alias for the empty interface type. + { + Type* empty = Type::make_empty_interface_type(loc); + Named_object* no = Named_object::make_type("any", NULL, empty, loc); + Named_type* nt = no->type_value(); + nt->set_is_alias(); + this->add_named_type(nt); + } + this->globals_->add_constant(Typed_identifier("true", Type::make_boolean_type(), loc), |