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
b47d1d90
Commit
b47d1d90
authored
Mar 03, 2016
by
Jason Merrill
Committed by
Jason Merrill
Mar 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* method.c (synthesized_method_walk): operator= can also be constexpr.
From-SVN: r233956
parent
a0a6a8c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
gcc/cp/ChangeLog
+2
-0
gcc/cp/method.c
+11
-2
gcc/testsuite/g++.dg/cpp1y/constexpr-assign1.C
+9
-0
No files found.
gcc/cp/ChangeLog
View file @
b47d1d90
2016-03-03 Jason Merrill <jason@redhat.com>
* method.c (synthesized_method_walk): operator= can also be constexpr.
* pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
...
...
gcc/cp/method.c
View file @
b47d1d90
...
...
@@ -1379,9 +1379,18 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
/* If that user-written default constructor would satisfy the
requirements of a constexpr constructor (7.1.5), the
implicitly-defined default constructor is constexpr. */
implicitly-defined default constructor is constexpr.
The implicitly-defined copy/move assignment operator is constexpr if
- X is a literal type, and
- the assignment operator selected to copy/move each direct base class
subobject is a constexpr function, and
- for each non-static data member of X that is of class type (or array
thereof), the assignment operator selected to copy/move that member is a
constexpr function. */
if
(
constexpr_p
)
*
constexpr_p
=
ctor_p
;
*
constexpr_p
=
ctor_p
||
(
assign_p
&&
cxx_dialect
>=
cxx14
);
move_p
=
false
;
switch
(
sfk
)
...
...
gcc/testsuite/g++.dg/cpp1y/constexpr-assign1.C
0 → 100644
View file @
b47d1d90
// { dg-do compile { target c++14 } }
struct
A
{
};
struct
B
{
A
a
;
constexpr
B
&
operator
=
(
const
B
&
)
=
default
;
};
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