From: Daniel Morsing Date: Mon, 22 Oct 2012 17:14:30 +0000 (+0200) Subject: cmd/gc: Mark use of builtin functions as calls. X-Git-Tag: go1.1rc2~2069 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=48af64b2956c9cd2618588d3d678ff099ced89a5;p=gostls13.git cmd/gc: Mark use of builtin functions as calls. Fixes #4097. R=rsc CC=golang-dev, gri https://golang.org/cl/6749059 --- diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c index 2ee468a58a..cebc2ff8a9 100644 --- a/src/cmd/gc/typecheck.c +++ b/src/cmd/gc/typecheck.c @@ -245,6 +245,12 @@ callrecv(Node *n) case OCALLINTER: case OCALLFUNC: case ORECV: + case OCAP: + case OLEN: + case OCOPY: + case ONEW: + case OAPPEND: + case ODELETE: return 1; } diff --git a/test/fixedbugs/issue4097.go b/test/fixedbugs/issue4097.go new file mode 100644 index 0000000000..2c999a8336 --- /dev/null +++ b/test/fixedbugs/issue4097.go @@ -0,0 +1,11 @@ +// 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 foo + +var s [][10]int +const m = len(s[len(s)-1]) // ERROR "must be constant" +