compiler: improve type handling for string concat ops on constants
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 13 Apr 2019 01:03:55 +0000 (01:03 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 13 Apr 2019 01:03:55 +0000 (01:03 +0000)
commitfdc59f56c1038ce194b72aebe29ac9cd4150205c
tree8a84c446c3b83550be24819a0adf3496f802642f
parentb15937488e5738ae2d4653dcc10acbd95eb649b5
compiler: improve type handling for string concat ops on constants

    Resolve a small problem with concatenation of string constants: in a
    string concat X + Y where X has named type and Y has abstract string
    type, insure that the result has X's type, and disable folding if the
    both sides have a concrete type that does not match.

    Fixes golang/go#31412.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171797

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