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
c623f837
Commit
c623f837
authored
Dec 14, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Permit omitting &T in composite literal.
From-SVN: r182331
parent
e6f52784
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
gcc/go/gofrontend/expressions.cc
+17
-3
No files found.
gcc/go/gofrontend/expressions.cc
View file @
c623f837
...
@@ -12783,14 +12783,23 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
...
@@ -12783,14 +12783,23 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
}
}
}
}
Type
*
pt
=
type
->
points_to
();
bool
is_pointer
=
false
;
if
(
pt
!=
NULL
)
{
is_pointer
=
true
;
type
=
pt
;
}
Expression
*
ret
;
if
(
type
->
is_error
())
if
(
type
->
is_error
())
return
Expression
::
make_error
(
this
->
location
());
return
Expression
::
make_error
(
this
->
location
());
else
if
(
type
->
struct_type
()
!=
NULL
)
else
if
(
type
->
struct_type
()
!=
NULL
)
ret
urn
this
->
lower_struct
(
gogo
,
type
);
ret
=
this
->
lower_struct
(
gogo
,
type
);
else
if
(
type
->
array_type
()
!=
NULL
)
else
if
(
type
->
array_type
()
!=
NULL
)
ret
urn
this
->
lower_array
(
type
);
ret
=
this
->
lower_array
(
type
);
else
if
(
type
->
map_type
()
!=
NULL
)
else
if
(
type
->
map_type
()
!=
NULL
)
ret
urn
this
->
lower_map
(
gogo
,
function
,
inserter
,
type
);
ret
=
this
->
lower_map
(
gogo
,
function
,
inserter
,
type
);
else
else
{
{
error_at
(
this
->
location
(),
error_at
(
this
->
location
(),
...
@@ -12798,6 +12807,11 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
...
@@ -12798,6 +12807,11 @@ Composite_literal_expression::do_lower(Gogo* gogo, Named_object* function,
"for composite literal"
));
"for composite literal"
));
return
Expression
::
make_error
(
this
->
location
());
return
Expression
::
make_error
(
this
->
location
());
}
}
if
(
is_pointer
)
ret
=
Expression
::
make_heap_composite
(
ret
,
this
->
location
());
return
ret
;
}
}
// Lower a struct composite literal.
// Lower a struct composite literal.
...
...
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