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
e1520358
Commit
e1520358
authored
Sep 21, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Better error message if method requires pointer receiver.
From-SVN: r191619
parent
74adb444
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
gcc/go/gofrontend/types.cc
+3
-2
No files found.
gcc/go/gofrontend/types.cc
View file @
e1520358
...
@@ -6845,7 +6845,8 @@ Interface_type::implements_interface(const Type* t, std::string* reason) const
...
@@ -6845,7 +6845,8 @@ Interface_type::implements_interface(const Type* t, std::string* reason) const
std
::
string
n
=
Gogo
::
message_name
(
p
->
name
());
std
::
string
n
=
Gogo
::
message_name
(
p
->
name
());
size_t
len
=
100
+
n
.
length
();
size_t
len
=
100
+
n
.
length
();
char
*
buf
=
new
char
[
len
];
char
*
buf
=
new
char
[
len
];
snprintf
(
buf
,
len
,
_
(
"method %s%s%s requires a pointer"
),
snprintf
(
buf
,
len
,
_
(
"method %s%s%s requires a pointer receiver"
),
open_quote
,
n
.
c_str
(),
close_quote
);
open_quote
,
n
.
c_str
(),
close_quote
);
reason
->
assign
(
buf
);
reason
->
assign
(
buf
);
delete
[]
buf
;
delete
[]
buf
;
...
@@ -9034,7 +9035,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
...
@@ -9034,7 +9035,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
Gogo
::
message_name
(
name
).
c_str
(),
ambig1
.
c_str
(),
Gogo
::
message_name
(
name
).
c_str
(),
ambig1
.
c_str
(),
ambig2
.
c_str
());
ambig2
.
c_str
());
else
if
(
found_pointer_method
)
else
if
(
found_pointer_method
)
error_at
(
location
,
"method requires a pointer"
);
error_at
(
location
,
"method requires a pointer
receiver
"
);
else
if
(
nt
==
NULL
&&
st
==
NULL
&&
it
==
NULL
)
else
if
(
nt
==
NULL
&&
st
==
NULL
&&
it
==
NULL
)
error_at
(
location
,
error_at
(
location
,
(
"reference to field %qs in object which "
(
"reference to field %qs in object which "
...
...
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