Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
234bdd5b
Commit
234bdd5b
authored
Apr 24, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Error for invalid use of ... in call.
From-SVN: r186739
parent
5e0cea66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
gcc/go/gofrontend/expressions.cc
+22
-2
No files found.
gcc/go/gofrontend/expressions.cc
View file @
234bdd5b
...
...
@@ -8641,7 +8641,14 @@ Call_expression::lower_varargs(Gogo* gogo, Named_object* function,
new_args
->
push_back
(
*
pa
);
else
if
(
this
->
is_varargs_
)
{
this
->
report_error
(
_
(
"too many arguments"
));
if
((
*
pa
)
->
type
()
->
is_slice_type
())
this
->
report_error
(
_
(
"too many arguments"
));
else
{
error_at
(
this
->
location
(),
_
(
"invalid use of %<...%> with non-slice"
));
this
->
set_is_error
();
}
return
;
}
else
...
...
@@ -8886,6 +8893,9 @@ Call_expression::check_argument_type(int i, const Type* parameter_type,
void
Call_expression
::
do_check_types
(
Gogo
*
)
{
if
(
this
->
classification
()
==
EXPRESSION_ERROR
)
return
;
Function_type
*
fntype
=
this
->
get_function_type
();
if
(
fntype
==
NULL
)
{
...
...
@@ -8921,7 +8931,17 @@ Call_expression::do_check_types(Gogo*)
}
// Note that varargs was handled by the lower_varargs() method, so
// we don't have to worry about it here.
// we don't have to worry about it here unless something is wrong.
if
(
this
->
is_varargs_
&&
!
this
->
varargs_are_lowered_
)
{
if
(
!
fntype
->
is_varargs
())
{
error_at
(
this
->
location
(),
_
(
"invalid use of %<...%> calling non-variadic function"
));
this
->
set_is_error
();
return
;
}
}
const
Typed_identifier_list
*
parameters
=
fntype
->
parameters
();
if
(
this
->
args_
==
NULL
)
...
...
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