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
86cf1084
Commit
86cf1084
authored
May 10, 2018
by
Jason Merrill
Committed by
Jason Merrill
May 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lambda.c (lambda_expr_this_capture): Improve logic.
From-SVN: r260122
parent
fa141e9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
gcc/cp/ChangeLog
+2
-0
gcc/cp/lambda.c
+10
-10
No files found.
gcc/cp/ChangeLog
View file @
86cf1084
2018-05-09 Jason Merrill <jason@redhat.com>
* lambda.c (lambda_expr_this_capture): Improve logic.
* decl.c (make_typename_type): s/parameters/arguments/.
* parser.c (cp_parser_nested_name_specifier_opt): Likewise.
* pt.c (make_pack_expansion): Correct error message.
...
...
gcc/cp/lambda.c
View file @
86cf1084
...
...
@@ -743,9 +743,7 @@ lambda_expr_this_capture (tree lambda, bool add_capture_p)
add_capture_p
=
false
;
/* Try to default capture 'this' if we can. */
if
(
!
this_capture
&&
(
!
add_capture_p
||
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE
(
lambda
)
!=
CPLD_NONE
))
if
(
!
this_capture
)
{
tree
lambda_stack
=
NULL_TREE
;
tree
init
=
NULL_TREE
;
...
...
@@ -756,9 +754,15 @@ lambda_expr_this_capture (tree lambda, bool add_capture_p)
3. a non-default capturing lambda function. */
for
(
tree
tlambda
=
lambda
;
;)
{
lambda_stack
=
tree_cons
(
NULL_TREE
,
tlambda
,
lambda_stack
);
if
(
add_capture_p
&&
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE
(
tlambda
)
==
CPLD_NONE
)
/* tlambda won't let us capture 'this'. */
break
;
if
(
add_capture_p
)
lambda_stack
=
tree_cons
(
NULL_TREE
,
tlambda
,
lambda_stack
);
tree
closure
=
LAMBDA_EXPR_CLOSURE
(
tlambda
);
tree
containing_function
...
...
@@ -807,10 +811,6 @@ lambda_expr_this_capture (tree lambda, bool add_capture_p)
init
=
LAMBDA_EXPR_THIS_CAPTURE
(
tlambda
);
break
;
}
if
(
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE
(
tlambda
)
==
CPLD_NONE
)
/* An outer lambda won't let us capture 'this'. */
break
;
}
if
(
init
)
...
...
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