]> Cypherpunks.ru repositories - gostls13.git/commitdiff
test: avoid "declared but not used" errors in shift1.go
authorIan Lance Taylor <iant@golang.org>
Sun, 20 Jul 2014 19:25:24 +0000 (12:25 -0700)
committerIan Lance Taylor <iant@golang.org>
Sun, 20 Jul 2014 19:25:24 +0000 (12:25 -0700)
I'm improving gccgo's detection of variables that are only set
but not used, and it triggers additional errors on this code.
The new gccgo errors are correct; gc seems to suppress them
due to the other, expected, errors.  This change uses the
variables so that no compiler will complain.

gccgo change is https://golang.org/cl/119920043 .

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/116050043

test/shift1.go

index 44a3792c4fa7ee2cd57e7e7dfe379eb69ef1033c..04f5321b73f21d2894d01cc5ec77ce9e74569a91 100644 (file)
@@ -238,4 +238,6 @@ func _() {
        z = (1. << s) << (1 << s)    // ERROR "non-integer|type complex128"
        z = (1. << s) << (1. << s)   // ERROR "non-integer|type complex128"
        z = (1.1 << s) << (1.1 << s) // ERROR "invalid|truncated|complex128"
+
+       _, _, _ = x, y, z
 }