compiler: Ignore result context in constant expressions.
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 14 Sep 2015 17:54:08 +0000 (17:54 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 14 Sep 2015 17:54:08 +0000 (17:54 +0000)
commit34e985136246df6832aed4dccdf7ed0cbcf4a9aa
tree2c86b3223c4eba8a77141ab30c23d32233a1007f
parent5c270a92a8ee5fe89dbadb743a3e4e2392b96dbc
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

From-SVN: r227758
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc