]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/go/gofrontend/expressions.cc
compiler: update iota handling, fix using iota in array length
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Feb 2018 01:57:42 +0000 (01:57 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Feb 2018 01:57:42 +0000 (01:57 +0000)
commitde590a611e701935c4b3a73e78ec69c2bdfa58a1
tree336c1452068533453093114132ffd040f836b06a
parent924f9f7e50ebbb9f311bd6e287534b143de7784f
compiler: update iota handling, fix using iota in array length

    CL 71750 changed the definition of how iota works.  This patch updates
    gccgo for the new definition.

    We've been mishandling iota appearing in a type that appears in a
    const expression, as in `c = len([iota]int{})`.  Correct that by copying
    type expressions when we copy an expression.  For simplicity only copy
    when it can change the size of a type, as that is the only case where
    iota in a type can affect the value of a constant (I think).  This is
    still a bunch of changes, but almost all boilerplate.

    Fixes golang/go#22341

    Reviewed-on: https://go-review.googlesource.com/91475

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257379 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/parse.h
gcc/go/gofrontend/types.cc
gcc/go/gofrontend/types.h