summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-05-24 15:25:09 -0700
committerRuss Cox <rsc@golang.org>2010-05-24 15:25:09 -0700
commit2a5057255a82896e1e0c0224e62c94ce4a74bbc5 (patch)
tree631b77c1d0118cc558f0117b4580343a6a48bee7
parent0348a75ad2e942d049612a382fd15360dcd858c0 (diff)
downloadgolang-2a5057255a82896e1e0c0224e62c94ce4a74bbc5.tar.gz
gc: bug280
Fixes issue 808. R=ken2 CC=golang-dev http://codereview.appspot.com/1273042
-rw-r--r--src/cmd/gc/align.c2
-rw-r--r--test/fixedbugs/bug280.go13
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c
index 00dd9d88e..0d4fa991f 100644
--- a/src/cmd/gc/align.c
+++ b/src/cmd/gc/align.c
@@ -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
index 000000000..869d44626
--- /dev/null
+++ b/test/fixedbugs/bug280.go
@@ -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"
+
+