Fixes #4610.
R=golang-dev, remyoudompheng, rsc
CC=golang-dev, nigeltao
https://golang.org/cl/
7058057
n->left = N;
goto ret;
}
- if((top & (Erv | Etop)) && !isptr[t->etype]) {
- yyerror("invalid indirect of %lN", n->left);
- goto error;
+ if(!isptr[t->etype]) {
+ if(top & (Erv | Etop)) {
+ yyerror("invalid indirect of %lN", n->left);
+ goto error;
+ }
+ goto ret;
}
ok |= Erv;
n->type = t->type;
--- /dev/null
+// errorcheck
+
+// Copyright 2012 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
+
+type bar struct {
+ x int
+}
+
+func main() {
+ var foo bar
+ _ = &foo{} // ERROR "is not a type"
+}
+