From: Jakub Jelinek Date: Tue, 30 Nov 2021 12:30:27 +0000 (+0100) Subject: libstdc++: Add [[nodiscard]] to std::byteswap X-Git-Tag: basepoints/gcc-13~2690 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92084a6dcda8aaee538b4512bbaf161e1155a296;p=thirdparty%2Fgcc.git libstdc++: Add [[nodiscard]] to std::byteswap This patch adds [[nodiscard]] to std::byteswap, because the function template doesn't do anything useful if the result isn't used. 2021-11-30 Jakub Jelinek * include/std/bit (byteswap): Add [[nodiscard]]. --- diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index 18ce5ca220c1..4facb6150142 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -83,6 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Reverse order of bytes in the object representation of `value`. template + [[nodiscard]] constexpr enable_if_t::value, _Tp> byteswap(_Tp __value) noexcept {