From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 7EFE93858402; Tue, 30 Nov 2021 12:33:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7EFE93858402 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-5623] libstdc++: Add [[nodiscard]] to std::byteswap X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: 365cd5f9ba812c389b404a53d99ab5dded5097f4 X-Git-Newrev: 92084a6dcda8aaee538b4512bbaf161e1155a296 Message-Id: <20211130123335.7EFE93858402@sourceware.org> Date: Tue, 30 Nov 2021 12:33:35 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2021 12:33:35 -0000 https://gcc.gnu.org/g:92084a6dcda8aaee538b4512bbaf161e1155a296 commit r12-5623-g92084a6dcda8aaee538b4512bbaf161e1155a296 Author: Jakub Jelinek Date: Tue Nov 30 13:30:27 2021 +0100 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: --- 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 18ce5ca220c..4facb615014 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 {