This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug go/61322] New: gccgo: spurious "incompatible type for field 2 in struct construction" error [GoSmith]


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]