Commit 493a9d2f authored by Russ Cox's avatar Russ Cox

put toplevel & check back and add test

R=ken
OCL=17307
CL=17307
parent 2e4b8d94
......@@ -754,6 +754,8 @@ uexpr:
}
| '&' uexpr
{
if($2->op == OCONV && !func)
yyerror("& of composite literal at top level");
$$ = nod(OADDR, $2, N);
}
| '+' uexpr
......@@ -1179,11 +1181,13 @@ xfndcl:
{
maxarg = 0;
stksize = 0;
func++;
} fndcl fnbody
{
$$ = $3;
$$->nbody = $4;
funcbody($$);
func--;
}
fndcl:
......
// errchk $G $D/$F.go
// Copyright 2009 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
var a = &[]int{1,2}; // ERROR "composite"
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