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
4e90195a
Commit
4e90195a
authored
Mar 27, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error for return with no values when result parameters are not named.
From-SVN: r171576
parent
7e3b6543
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
gcc/go/gofrontend/statements.cc
+13
-3
No files found.
gcc/go/gofrontend/statements.cc
View file @
4e90195a
...
...
@@ -2581,10 +2581,20 @@ Return_statement::do_determine_types()
void
Return_statement
::
do_check_types
(
Gogo
*
)
{
const
Typed_identifier_list
*
results
=
this
->
results_
;
if
(
this
->
vals_
==
NULL
)
return
;
{
if
(
results
!=
NULL
&&
!
results
->
empty
()
&&
results
->
front
().
name
().
empty
())
{
// The result parameters are not named, which means that we
// need to supply values for them.
this
->
report_error
(
_
(
"not enough arguments to return"
));
}
return
;
}
const
Typed_identifier_list
*
results
=
this
->
results_
;
if
(
results
==
NULL
)
{
this
->
report_error
(
_
(
"return with value in function "
...
...
@@ -2621,7 +2631,7 @@ Return_statement::do_check_types(Gogo*)
}
if
(
pt
!=
results
->
end
())
this
->
report_error
(
_
(
"not enough
values in return statement
"
));
this
->
report_error
(
_
(
"not enough
arguments to return
"
));
}
// Build a RETURN_EXPR tree.
...
...
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