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
e952450a
Commit
e952450a
authored
Oct 17, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Don't warn for unknown type when importing anonymous field.
From-SVN: r203772
parent
2ed3eba1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
gcc/go/gofrontend/types.cc
+18
-4
No files found.
gcc/go/gofrontend/types.cc
View file @
e952450a
...
@@ -5263,11 +5263,25 @@ Struct_type::do_import(Import* imp)
...
@@ -5263,11 +5263,25 @@ Struct_type::do_import(Import* imp)
// that an embedded builtin type is accessible from another
// that an embedded builtin type is accessible from another
// package (we know that all the builtin types are not
// package (we know that all the builtin types are not
// exported).
// exported).
if
(
name
.
empty
()
&&
ftype
->
deref
()
->
named_type
()
!=
NULL
)
// This is called during parsing, before anything is
// lowered, so we have to be careful to avoid dereferencing
// an unknown type name.
if
(
name
.
empty
())
{
{
const
std
::
string
fn
(
ftype
->
deref
()
->
named_type
()
->
name
());
Type
*
t
=
ftype
;
if
(
fn
[
0
]
>=
'a'
&&
fn
[
0
]
<=
'z'
)
if
(
t
->
classification
()
==
Type
::
TYPE_POINTER
)
name
=
'.'
+
imp
->
package
()
->
pkgpath
()
+
'.'
+
fn
;
{
// Very ugly.
Pointer_type
*
ptype
=
static_cast
<
Pointer_type
*>
(
t
);
t
=
ptype
->
points_to
();
}
std
::
string
tname
;
if
(
t
->
forward_declaration_type
()
!=
NULL
)
tname
=
t
->
forward_declaration_type
()
->
name
();
else
if
(
t
->
named_type
()
!=
NULL
)
tname
=
t
->
named_type
()
->
name
();
if
(
!
tname
.
empty
()
&&
tname
[
0
]
>=
'a'
&&
tname
[
0
]
<=
'z'
)
name
=
'.'
+
imp
->
package
()
->
pkgpath
()
+
'.'
+
tname
;
}
}
Struct_field
sf
(
Typed_identifier
(
name
,
ftype
,
imp
->
location
()));
Struct_field
sf
(
Typed_identifier
(
name
,
ftype
,
imp
->
location
()));
...
...
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