From 67a2ed754eac77800dd4e4008b59917f95e02bd6 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 13 Jul 2018 18:25:27 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262641 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a18e3f3b9f9..8aaa045cb6d 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 e7d0b752219..2c2ae1cf1c6 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) -- 2.11.4.GIT