diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-08-26 12:55:02 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-08-26 15:29:03 +0100 |
commit | 1c0288065b8184e0051d846b0940027b97ea0eb4 (patch) | |
tree | a58df9efcff99cc36775375840ce35fc4eb9be9a /libgcc/fixed-bit.c | |
parent | 1b0b969df794d0401ccb9279d44302d1e4729f15 (diff) | |
download | gcc-1c0288065b8184e0051d846b0940027b97ea0eb4.zip gcc-1c0288065b8184e0051d846b0940027b97ea0eb4.tar.gz gcc-1c0288065b8184e0051d846b0940027b97ea0eb4.tar.bz2 |
libstdc++: Simplify std::error_code and std::error_condition
This removes the redundant operator=(E) from std::error_code and
std::error_condition. Without that overload, assignment from a custom
type will use the templated constructor to create a temporary and then
use the trivial copy assignment operator. With the overloaded
assignment, we have to check the constraints twice as often, because
that overload and its constraints are checked for simple copy
assignments (including the one in the overloaded assignment operator
itself!)
Also add tests that ADL is used as per LWG 3629.
libstdc++-v3/ChangeLog:
* include/std/system_error (error_code::_Check): New alias
template for constructor SFINAE constraint.
(error_code::error_code(ErrorCodeEnum)): Use it.
(error_code::operator=(ErrorCodeEnum)): Remove.
(error_condition::_Check): New alias template for constraint.
(error_condition::error_condition(ErrorConditionEnum)): Use it.
(error_condition::operator=(ErrorConditionEnum)): Remove.
* testsuite/19_diagnostics/error_code/cons/1.cc: Check
constructor taking user-defined error enum.
* testsuite/19_diagnostics/error_condition/cons/1.cc: Likewise.
Diffstat (limited to 'libgcc/fixed-bit.c')
0 files changed, 0 insertions, 0 deletions