compiler: Ignore result context in constant expressions.
commitc999c2a78bd5898cbc73b3a3402d5fbb6004e6a1
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Sep 2015 17:54:08 +0000 (14 17:54 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Sep 2015 17:54:08 +0000 (14 17:54 +0000)
tree2c86b3223c4eba8a77141ab30c23d32233a1007f
parent10340a85d4123d57db461ddf4de3b8c6a3a72713
compiler: Ignore result context in constant expressions.

    When evaluating a constant expression, the gofrontend would incorrectly
    force each operand to be represented as the resulting type before
    checking if the operation was valid with the untyped constants.
    According to the language specification on constant
    expressions(http://golang.org/ref/spec#Constant_expressions): "Untyped
    boolean, numeric, and string constants may be used as operands wherever
    it is legal to use an operand of boolean, numeric, or string type,
    respectively."

    Fixes golang/go#11566.

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

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