Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
5b62ba14
Commit
5b62ba14
authored
May 31, 2011
by
Anthony Martin
Committed by
Russ Cox
May 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: disallow ... in type conversions
Fixes #1866. R=bradfitz, rsc CC=golang-dev
https://golang.org/cl/4548073
parent
c72dbaf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
src/cmd/gc/typecheck.c
src/cmd/gc/typecheck.c
+1
-1
test/ddd1.go
test/ddd1.go
+1
-0
No files found.
src/cmd/gc/typecheck.c
View file @
5b62ba14
...
...
@@ -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
;
...
...
test/ddd1.go
View file @
5b62ba14
...
...
@@ -43,4 +43,5 @@ func bad(args ...int) {
var
x
int
_
=
unsafe
.
Pointer
(
&
x
...
)
// ERROR "[.][.][.]"
_
=
unsafe
.
Sizeof
(
x
...
)
// ERROR "[.][.][.]"
_
=
[
...
]
byte
(
"foo"
)
// ERROR "[.][.][.]"
}
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