From: Ian Lance Taylor Date: Fri, 13 Jul 2018 18:25:27 +0000 (+0000) Subject: compiler: fix parsing of composite literals with omitted pointer types X-Git-Tag: basepoints/gcc-10~5394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=113950b77af34087b3496d5c994cbcc8005d910e;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a18e3f3b9f94..8aaa045cb6dd 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 e7d0b7522195..2c2ae1cf1c6a 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)