Skip to content

Commit 3f7e72e

Browse files
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 Change-Id: I32f0c7154e6525871a5304e92215f4b3a64eac32 Reviewed-on: https://go-review.googlesource.com/123479 Reviewed-by: Than McIntosh <[email protected]>
1 parent 267686f commit 3f7e72e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

go/expressions.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13666,6 +13666,7 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
1366613666

1366713667
for (int depth = 0; depth < this->depth_; ++depth)
1366813668
{
13669+
type = type->deref();
1366913670
if (type->array_type() != NULL)
1367013671
type = type->array_type()->element_type();
1367113672
else if (type->map_type() != NULL)

0 commit comments

Comments
 (0)