Commit 5b62ba14 authored by Anthony Martin's avatar Anthony Martin Committed by Russ Cox

gc: disallow ... in type conversions

Fixes #1866.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4548073
parent c72dbaf3
......@@ -794,7 +794,7 @@ reswitch:
defaultlit(&n->left, T);
l = n->left;
if(l->op == OTYPE) {
if(n->isddd)
if(n->isddd || l->type->bound == -100)
yyerror("invalid use of ... in type conversion", l);
// pick off before type-checking arguments
ok |= Erv;
......
......@@ -43,4 +43,5 @@ func bad(args ...int) {
var x int
_ = unsafe.Pointer(&x...) // ERROR "[.][.][.]"
_ = unsafe.Sizeof(x...) // ERROR "[.][.][.]"
_ = [...]byte("foo") // ERROR "[.][.][.]"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment