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
948d0d91
Commit
948d0d91
authored
Jun 09, 2017
by
Jason Merrill
Committed by
Jason Merrill
Jun 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* constexpr.c (potential_constant_expression_1): Allow 'this' capture.
From-SVN: r249077
parent
a1f427e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
+15
-1
gcc/cp/ChangeLog
+4
-0
gcc/cp/constexpr.c
+1
-1
gcc/testsuite/g++.dg/cpp1z/lambda-this3.C
+10
-0
No files found.
gcc/cp/ChangeLog
View file @
948d0d91
2017-06-09 Jason Merrill <jason@redhat.com>
* constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2017-06-09 Jan Hubicka <hubicka@ucw.cz>
* class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
...
...
gcc/cp/constexpr.c
View file @
948d0d91
...
...
@@ -5296,7 +5296,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
{
tree
x
=
TREE_OPERAND
(
t
,
0
);
STRIP_NOPS
(
x
);
if
(
is_this_parameter
(
x
))
if
(
is_this_parameter
(
x
)
&&
!
is_capture_proxy
(
x
)
)
{
if
(
DECL_CONTEXT
(
x
)
&&
!
DECL_DECLARED_CONSTEXPR_P
(
DECL_CONTEXT
(
x
)))
...
...
gcc/testsuite/g++.dg/cpp1z/lambda-this3.C
0 → 100644
View file @
948d0d91
// { dg-options -std=c++1z }
struct
S
{
int
i
;
constexpr
S
()
:
i
(
5
)
{
([
*
this
]
()
{
return
i
+
10
;
}());
}
constexpr
operator
int
()
const
{
return
i
;
}
};
constexpr
int
x
=
S
();
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