Commit graph

3 commits

Author SHA1 Message Date
Emmanuel Odeke 53fd522c0d all: make copyright headers consistent with one space after period
Follows suit with https://go-review.googlesource.com/#/c/20111.

Generated by running
$ grep -R 'Go Authors.  All' * | cut -d":" -f1 | while read F;do perl -pi -e 's/Go
Authors.  All/Go Authors. All/g' $F;done

The code in cmd/internal/unvendor wasn't changed.

Fixes #15213

Change-Id: I4f235cee0a62ec435f9e8540a1ec08ae03b1a75f
Reviewed-on: https://go-review.googlesource.com/21819
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-02 13:43:18 +00:00
Matthew Dempsky 27691fa467 cmd/compile: recognize !typedbool is typed
Adding the evconst(n) call for OANDAND and OOROR in
golang.org/cl/18262 was originally just to parallel the above iscmp
branch, but upon further inspection it seemed odd that removing it
caused test/fixedbugs/issue6671.go's

    var b mybool
    // ...
    b = bool(true) && true // ERROR "cannot use"

to start failing (i.e., by not emitting the expected "cannot use"
error).

The problem is that evconst(n)'s settrue and setfalse paths always
reset n.Type to idealbool, even for logical operators where n.Type
should preserve the operand type.  Adding the evconst(n) call for
OANDAND/OOROR inadvertantly worked around this by turning the later
evconst(n) call at line 2167 into a noop, so the "n.Type = t"
assignment at line 739 would preserve the operand type.

However, that means evconst(n) was still clobbering n.Type for ONOT,
so declarations like:

    const _ bool = !mybool(true)

were erroneously accepted.

Update #13821.

Change-Id: I18e37287f05398fdaeecc0f0d23984e244f025da
Reviewed-on: https://go-review.googlesource.com/18362
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-07 21:43:47 +00:00
Matthew Dempsky be20948e27 cmd/compile: recognize bool(true) as a constant expression
Fixes #13821.

Change-Id: I4a28a92d137edac3061537af25ac9d7aba411a66
Reviewed-on: https://go-review.googlesource.com/18262
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-06 14:38:33 +00:00