Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
493a9d2f
Commit
493a9d2f
authored
Oct 16, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put toplevel & check back and add test
R=ken OCL=17307 CL=17307
parent
2e4b8d94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
go.y
src/cmd/gc/go.y
+4
-0
addr.go
test/addr.go
+9
-0
No files found.
src/cmd/gc/go.y
View file @
493a9d2f
...
...
@@ -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
:
...
...
test/addr.go
0 → 100644
View file @
493a9d2f
// 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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment