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
23823e0a
Commit
23823e0a
authored
Sep 30, 2009
by
Jason Merrill
Committed by
Jason Merrill
Sep 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* parser.c (cp_parser_lambda_expression): Don't add __ to __this.
From-SVN: r152330
parent
bfd6b23c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
gcc/cp/ChangeLog
+4
-0
gcc/cp/parser.c
+12
-7
No files found.
gcc/cp/ChangeLog
View file @
23823e0a
2009-09-30 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_lambda_expression): Don't add __ to __this.
2009-09-30 Jason Merrill <jason@redhat.com>
* cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
2009-09-29 John Freeman <jfreeman08@gmail.com>
...
...
gcc/cp/parser.c
View file @
23823e0a
...
...
@@ -7077,21 +7077,26 @@ cp_parser_lambda_expression (cp_parser* parser)
for
(
elt
=
LAMBDA_EXPR_CAPTURE_LIST
(
lambda_expr
);
elt
;
elt
=
next
)
{
tree
field
=
TREE_PURPOSE
(
elt
);
char
*
buf
;
next
=
TREE_CHAIN
(
elt
);
TREE_CHAIN
(
elt
)
=
newlist
;
newlist
=
elt
;
/* Also add __ to the beginning of the field name so that code
outside the lambda body can't see the captured name. We could
just remove the name entirely, but this is more useful for
debugging. */
tree
field
=
TREE_PURPOSE
(
elt
);
char
*
buf
=
(
char
*
)
alloca
(
IDENTIFIER_LENGTH
(
DECL_NAME
(
field
))
+
3
);
if
(
field
==
LAMBDA_EXPR_THIS_CAPTURE
(
lambda_expr
))
/* The 'this' capture already starts with __. */
continue
;
buf
=
(
char
*
)
alloca
(
IDENTIFIER_LENGTH
(
DECL_NAME
(
field
))
+
3
);
buf
[
1
]
=
buf
[
0
]
=
'_'
;
memcpy
(
buf
+
2
,
IDENTIFIER_POINTER
(
DECL_NAME
(
field
)),
IDENTIFIER_LENGTH
(
DECL_NAME
(
field
))
+
1
);
DECL_NAME
(
field
)
=
get_identifier
(
buf
);
next
=
TREE_CHAIN
(
elt
);
TREE_CHAIN
(
elt
)
=
newlist
;
newlist
=
elt
;
}
LAMBDA_EXPR_CAPTURE_LIST
(
lambda_expr
)
=
newlist
;
}
...
...
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