aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-02-26 11:47:27 +0000
committerJonathan Wakely <jwakely@redhat.com>2024-02-28 11:27:46 +0000
commitcf918498ab7c717e3c6badab44340117af53ec35 (patch)
tree744257bebb2084fc3582b664afb7919bcb01d22d /gcc
parent5c22de3fecb6c853fcdf3e39a4cfe594846079a1 (diff)
downloadgcc-cf918498ab7c717e3c6badab44340117af53ec35.zip
gcc-cf918498ab7c717e3c6badab44340117af53ec35.tar.gz
gcc-cf918498ab7c717e3c6badab44340117af53ec35.tar.bz2
libstdc++: Consistently use noexcept, constexpr, nodiscard on bitmask ops
The bitwise operators for combining bitmask types such as std::launch are not consistently annotated with noexcept, constexpr, and nodiscard. This is the subject of LWG 3977, although the proposed resolution doesn't work. We can make the changes in libstdc++ anyway though. libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (operator|, operator&): Add noexcept. * include/bits/fs_fwd.h (operator&, operator|, operator^) (operator~): Add nodiscard to overloads for copy_options, perms, perm_options, and directory_options. * include/bits/ios_base.h (operator&, operator|, operator^) (operator~): Add nodiscard and noexcept to overloads for _Ios_Fmtflags, _Ios_Openmode, and _Ios_Iostate. (operator|=, operator&=, operator^=): Add constexpr for C++14. * include/bits/regex_constants.h (operator&, operator|, operator^) (operator~): Add nodiscard and noexcept to overloads for syntax_option_type and match_flag_type. (operator|=, operator&=, operator^=): Add noexcept. * include/std/charconv (operator&, operator|, operator^) (operator~): Add nodiscard to overloads for chars_format. * include/std/future (operator&, operator|, operator^) (operator~): Add nodiscard for overloads for launch. (operator&=, operator|=, operator^=): Add constexpr for C++14. * include/experimental/bits/fs_fwd.h (operator&, operator|) (operator^, operator~): Add nodiscard to overloads for copy_options, perms, and directory_options. * testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc: Add dg-warning for nodiscard warnings. * testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc: Likewise. * testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc: Likewise. * testsuite/27_io/filesystem/operations/bitmask_types.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions