https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61322
Bug ID: 61322
Summary: gccgo: spurious "incompatible type for field 2 in
struct construction" error [GoSmith]
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: go
Assignee: ian at airs dot com
Reporter: dvyukov at google dot com
CC: cmang at google dot com
gcc version 4.10.0 20140516 (experimental) (GCC)
The program is:
package main
func main() {
x := [1]int16{0}
y := make([][2]int, 1)
var s *string
_ = func() {
(x)[y[(func() int)(nil)()][len(*s)]]++
}
}
$ go build -compiler=gccgo src.go
src.go:6:6: error: incompatible type for field 2 in struct construction
_ = func() {
^
src.go:6:6: error: too few expressions for struct
src.go:7:34: error: expected pointer
(x)[y[(func() int)(nil)()][len(*s)]]++
gc compiles successfully.