From 92084a6dcda8aaee538b4512bbaf161e1155a296 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 30 Nov 2021 13:30:27 +0100 Subject: [PATCH] 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]]. --- libstdc++-v3/include/std/bit | 1 + 1 file changed, 1 insertion(+) 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 { -- 2.47.2