Fixes #6406.
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/
46900043
n->etype = 1;
return;
}
+
+ // have already complained about n being undefined
+ if(n->op == ONONAME)
+ return;
+
yyerror("cannot assign to %N", n);
}
--- /dev/null
+// errorcheck
+
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func main() {
+ s = "bob" // ERROR "undefined.*s"
+ _ = s // ERROR "undefined.*s"
+}
func main() {
mine() // GCCGO_ERROR "not enough arguments"
- c = mine() // ERROR "undefined.*c|not enough arguments" "cannot assign to c"
+ c = mine() // ERROR "undefined.*c|not enough arguments"
}