This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/61322] New: gccgo: spurious "incompatible type for field 2 in struct construction" error [GoSmith]
- From: "dvyukov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 May 2014 16:25:42 +0000
- Subject: [Bug go/61322] New: gccgo: spurious "incompatible type for field 2 in struct construction" error [GoSmith]
- Auto-submitted: auto-generated
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.