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
02a72827
Commit
02a72827
authored
Sep 20, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error for undefined name in imported package.
Avoid emitting some followon errors. From-SVN: r179020
parent
6fa29799
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
gcc/go/gofrontend/expressions.cc
+7
-2
gcc/go/gofrontend/parse.cc
+10
-3
No files found.
gcc/go/gofrontend/expressions.cc
View file @
02a72827
...
...
@@ -9730,7 +9730,10 @@ Call_result_expression::do_type()
if
(
fntype
==
NULL
)
{
if
(
ce
->
issue_error
())
this
->
report_error
(
_
(
"expected function"
));
{
if
(
!
ce
->
fn
()
->
type
()
->
is_error
())
this
->
report_error
(
_
(
"expected function"
));
}
this
->
set_is_error
();
return
Type
::
make_error_type
();
}
...
...
@@ -10043,7 +10046,9 @@ Array_index_expression::do_check_types(Gogo*)
this
->
report_error
(
_
(
"index must be integer"
));
if
(
this
->
end_
!=
NULL
&&
this
->
end_
->
type
()
->
integer_type
()
==
NULL
&&
!
this
->
end_
->
is_nil_expression
())
&&
!
this
->
end_
->
type
()
->
is_error
()
&&
!
this
->
end_
->
is_nil_expression
()
&&
!
this
->
end_
->
is_error_expression
())
this
->
report_error
(
_
(
"slice end must be integer"
));
Array_type
*
array_type
=
this
->
array_
->
type
()
->
array_type
();
...
...
gcc/go/gofrontend/parse.cc
View file @
02a72827
...
...
@@ -335,10 +335,17 @@ Parse::type_name(bool issue_error)
bool
ok
=
true
;
if
(
named_object
==
NULL
)
{
if
(
package
!=
NULL
)
ok
=
false
;
else
if
(
package
==
NULL
)
named_object
=
this
->
gogo_
->
add_unknown_name
(
name
,
location
);
else
{
const
std
::
string
&
packname
(
package
->
package_value
()
->
name
());
error_at
(
location
,
"reference to undefined identifer %<%s.%s%>"
,
Gogo
::
message_name
(
packname
).
c_str
(),
Gogo
::
message_name
(
name
).
c_str
());
issue_error
=
false
;
ok
=
false
;
}
}
else
if
(
named_object
->
is_type
())
{
...
...
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