]> Cypherpunks repositories - gostls13.git/commitdiff
gc: bug280
authorRuss Cox <rsc@golang.org>
Mon, 24 May 2010 22:25:09 +0000 (15:25 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 24 May 2010 22:25:09 +0000 (15:25 -0700)
Fixes #808.

R=ken2
CC=golang-dev
https://golang.org/cl/1273042

src/cmd/gc/align.c
test/fixedbugs/bug280.go [new file with mode: 0644]

index 00dd9d88eaae1d265ff16516bc6d6c919f5380bc..0d4fa991f3f8a37536893017b5371b7d050e4a34 100644 (file)
@@ -239,6 +239,8 @@ dowidth(Type *t)
                        w = sizeof_Array;
                        checkwidth(t->type);
                }
+               else if(t->bound == -100)
+                       yyerror("use of [...] array outside of array literal");
                else
                        fatal("dowidth %T", t); // probably [...]T
                break;
diff --git a/test/fixedbugs/bug280.go b/test/fixedbugs/bug280.go
new file mode 100644 (file)
index 0000000..869d446
--- /dev/null
@@ -0,0 +1,13 @@
+// errchk $G $D/$F.go
+
+// Copyright 2010 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.
+
+// http://code.google.com/p/go/issues/detail?id=808
+
+package main
+
+type A [...]int        // ERROR "outside of array literal"
+
+