diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-07-13 18:25:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-07-13 18:25:27 +0000 |
commit | 113950b77af34087b3496d5c994cbcc8005d910e (patch) | |
tree | 182d2e07753d75755ca366199ec36b2e87ca3b0c | |
parent | 6b34716ba421d05190d66ab4660a48c0446f76c7 (diff) | |
download | gcc-113950b77af34087b3496d5c994cbcc8005d910e.zip gcc-113950b77af34087b3496d5c994cbcc8005d910e.tar.gz gcc-113950b77af34087b3496d5c994cbcc8005d910e.tar.bz2 |
compiler: fix parsing of composite literals with omitted pointer types
The frontend could parse omitted pointer typess at the end of the
type, but not in the middle, so code like []*[][]int{{{1}}} failed.
Test case is in https://golang.org/cl/123477.
Fixes golang/go#26340
Reviewed-on: https://go-review.googlesource.com/123479
From-SVN: r262641
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a18e3f3..8aaa045 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -267686fd1dffbc03e610e9f17dadb4e72c75f18d +3f7e72eca3f9221e67c055841d42851aa6a66aff 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/expressions.cc b/gcc/go/gofrontend/expressions.cc index e7d0b75..2c2ae1c 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -13666,6 +13666,7 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function, for (int depth = 0; depth < this->depth_; ++depth) { + type = type->deref(); if (type->array_type() != NULL) type = type->array_type()->element_type(); else if (type->map_type() != NULL) |