From patchwork Thu Sep 26 20:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1989924 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IEaalOUh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XF53L4FXMz1xtG for ; Fri, 27 Sep 2024 06:36:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F3F73858C31 for ; Thu, 26 Sep 2024 20:36:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 8368E3858D39 for ; Thu, 26 Sep 2024 20:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8368E3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8368E3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727382942; cv=none; b=AeisGF/gu8xzoM4+wZ9BxLy2AOKuxRcIrhkk419nCbEKWJ6um0F1QXD0i8f1veHt0D/bcF+1UiSZfGJeyJah+DqnBvMEIn3chrkvEMfgI4XwR6s9PlOqr2/fccg9/EPcNa5ZmwmEqSTAGlNammwj1NP5GzoOY+19b4UiwdofuWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727382942; c=relaxed/simple; bh=XfbiGqhaHA+88RDoE4iusSc7yOn/vVfPA1rub5g5d/0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hnxwIaJgh+qy34dkr3G1cZtQ182LN8Mikp6Y0VNh/yPyiZpIitkiUVwywKvVg6KUA7g0VZ7/LRjOUWi5LucD2aNCalRThSmHNntitGJ6DoI1gqhTETy/IDIF7NA0OlcNjNWAwDk77kVeUqQY8cHmkQJ8g+WStfGTzf0pPcjLOqc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727382938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DBAB4QGNUb0nVflb7wdp9g2UmFanhw/LqH0qjC4kY/4=; b=IEaalOUhXU7QP1GlE/K9FJiWh/tAozULUILWjJf+joXKQoya+xQPteMTvnxdqqZNLktefG 8R8K2/fonSt8NznbbFyqKbeK+nYRuU7eP2vy2aO1fy9RuVpJpphZ02vqY6u2bl9d6Ndkfe LfCoh0g7oDxmWYOH1tRoIwCs51e7Cs8= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-aEXoX1ItN3CRVCSECiX_LA-1; Thu, 26 Sep 2024 16:35:36 -0400 X-MC-Unique: aEXoX1ItN3CRVCSECiX_LA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AC02D193610E; Thu, 26 Sep 2024 20:35:35 +0000 (UTC) Received: from localhost (unknown [10.42.28.136]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 00FFD1956086; Thu, 26 Sep 2024 20:35:34 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add [[nodiscard]] to iostream members Date: Thu, 26 Sep 2024 21:35:17 +0100 Message-ID: <20240926203533.2068507-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. -- >8 -- These are all pure functions and MSVC also marks all of these as nodiscard except for std::basic_ios::tie() const, but that's been confirmed as an accidental omission. libstdc++-v3/ChangeLog: * include/bits/basic_ios.h (basic_ios::operator bool()): Add [[nodiscard]] attribute. (basic_ios::operator!(), basic_ios::rdstate()) (basic_ios::good(), basic_ios::eof(), basic_ios::fail()) (basic_ios::bad(), basic_ios::exceptions(), basic_ios::tie()) (basic_ios::rdbuf(), basic_ios::fill()): Likewise. * include/bits/ios_base.h (ios_base::flags()): Likewise. (ios_base::precision(), ios_base::width(), ios_base::getloc()): Likewise. * include/std/fstream (basic_filebuf::is_open) (basic_ifstream::rdbuf(), basic_ifstream::is_open) (basic_ofstream::rdbuf(), basic_ofstream::is_open) (basic_fstream::rdbuf(), basic_fstream::is_open): Likewise. * include/std/spanstream (basic_spanbuf::span()) (basic_ispanstream::span(), basic_ispanstream::rdbuf()) (basic_ospanstream::span(), basic_ospanstream::rdbuf()) (basic_spanstream::span(), basic_spanstream::rdbuf()): Likewise. * include/std/sstream (basic_stringbuf::str()) (basic_istringstream::rdbuf(), basic_istringstream::str()) (basic_ostringstream::rdbuf(), basic_ostringstream::str()) (basic_stringstream::rdbuf(), basic_stringstream::str()): Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc: Suppress -Wunused-result warnings. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc: Likewise. --- libstdc++-v3/include/bits/basic_ios.h | 11 +++++++++++ libstdc++-v3/include/bits/ios_base.h | 4 ++++ libstdc++-v3/include/std/fstream | 10 ++++++++++ libstdc++-v3/include/std/spanstream | 7 +++++++ libstdc++-v3/include/std/sstream | 15 +++++++++++++++ .../extractors_arithmetic/char/01.cc | 4 ++-- .../extractors_arithmetic/wchar_t/01.cc | 4 ++-- 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index a2d8060edd2..8954ad16d63 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -120,6 +120,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * if (!a_stream) ... and while (a_stream) ... */ #if __cplusplus >= 201103L + _GLIBCXX_NODISCARD explicit operator bool() const { return !this->fail(); } #else @@ -127,6 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return this->fail() ? 0 : const_cast(this); } #endif + _GLIBCXX_NODISCARD bool operator!() const { return this->fail(); } @@ -139,6 +141,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * See std::ios_base::iostate for the possible bit values. Most * users will call one of the interpreting wrappers, e.g., good(). */ + _GLIBCXX_NODISCARD iostate rdstate() const { return _M_streambuf_state; } @@ -182,6 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * A wrapper around rdstate. */ + _GLIBCXX_NODISCARD bool good() const { return this->rdstate() == 0; } @@ -192,6 +196,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Note that other iostate flags may also be set. */ + _GLIBCXX_NODISCARD bool eof() const { return (this->rdstate() & eofbit) != 0; } @@ -203,6 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Checking the badbit in fail() is historical practice. * Note that other iostate flags may also be set. */ + _GLIBCXX_NODISCARD bool fail() const { return (this->rdstate() & (badbit | failbit)) != 0; } @@ -213,6 +219,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Note that other iostate flags may also be set. */ + _GLIBCXX_NODISCARD bool bad() const { return (this->rdstate() & badbit) != 0; } @@ -224,6 +231,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * This changes nothing in the stream. See the one-argument version * of exceptions(iostate) for the meaning of the return value. */ + _GLIBCXX_NODISCARD iostate exceptions() const { return _M_exception; } @@ -297,6 +305,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * stream. When this stream performs any I/O, the tied stream is * first flushed. For example, @c std::cin is tied to @c std::cout. */ + _GLIBCXX_NODISCARD basic_ostream<_CharT, _Traits>* tie() const { return _M_tie; } @@ -323,6 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * This does not change the state of the stream. */ + _GLIBCXX_NODISCARD basic_streambuf<_CharT, _Traits>* rdbuf() const { return _M_streambuf; } @@ -372,6 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * It defaults to a space (' ') in the current locale. */ + _GLIBCXX_NODISCARD char_type fill() const { diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index a649448e298..1418b18830a 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -689,6 +689,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief Access to format flags. * @return The format control flags for both input and output. */ + _GLIBCXX_NODISCARD fmtflags flags() const { return _M_flags; } @@ -759,6 +760,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Be careful if you try to give a definition of @a precision here; see * DR 189. */ + _GLIBCXX_NODISCARD streamsize precision() const { return _M_precision; } @@ -782,6 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Minimum field width refers to the number of characters. */ + _GLIBCXX_NODISCARD streamsize width() const { return _M_width; } @@ -833,6 +836,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * returns @c loc. Otherwise, it returns a copy of @c std::locale(), * the global C++ locale. */ + _GLIBCXX_NODISCARD locale getloc() const { return _M_ios_locale; } diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream index 665a17afee6..8f359404a48 100644 --- a/libstdc++-v3/include/std/fstream +++ b/libstdc++-v3/include/std/fstream @@ -273,6 +273,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Returns true if the external file is open. */ + _GLIBCXX_NODISCARD bool is_open() const throw() { return _M_file.is_open(); } @@ -670,6 +671,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } @@ -678,12 +680,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ + _GLIBCXX_NODISCARD bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 + _GLIBCXX_NODISCARD bool is_open() const { return _M_filebuf.is_open(); } @@ -942,6 +946,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } @@ -950,12 +955,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ + _GLIBCXX_NODISCARD bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 + _GLIBCXX_NODISCARD bool is_open() const { return _M_filebuf.is_open(); } @@ -1207,6 +1214,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } @@ -1215,12 +1223,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ + _GLIBCXX_NODISCARD bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 + _GLIBCXX_NODISCARD bool is_open() const { return _M_filebuf.is_open(); } diff --git a/libstdc++-v3/include/std/spanstream b/libstdc++-v3/include/std/spanstream index b86bd613489..98ad3fa856a 100644 --- a/libstdc++-v3/include/std/spanstream +++ b/libstdc++-v3/include/std/spanstream @@ -110,6 +110,7 @@ template } // [spanbuf.members], member functions + [[nodiscard]] std::span<_CharT> span() const noexcept { @@ -277,12 +278,14 @@ template } // [ispanstream.members], member functions + [[nodiscard]] basic_spanbuf<_CharT, _Traits>* rdbuf() const noexcept { return const_cast*>(std::__addressof(_M_sb)); } + [[nodiscard]] std::span span() const noexcept { return _M_sb.span(); } @@ -356,12 +359,14 @@ template } // [ospanstream.members], member functions + [[nodiscard]] basic_spanbuf<_CharT, _Traits>* rdbuf() const noexcept { return const_cast*>(std::__addressof(_M_sb)); } + [[nodiscard]] std::span<_CharT> span() const noexcept { return _M_sb.span(); } @@ -424,12 +429,14 @@ template } // [spanstream.members], members + [[nodiscard]] basic_spanbuf<_CharT, _Traits>* rdbuf() const noexcept { return const_cast*>(std::__addressof(_M_sb)); } + [[nodiscard]] std::span<_CharT> span() const noexcept { return _M_sb.span(); } diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream index fd24f655218..aaa89b2bed8 100644 --- a/libstdc++-v3/include/std/sstream +++ b/libstdc++-v3/include/std/sstream @@ -247,6 +247,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * character sequence is equal to the input sequence; otherwise, it * is equal to the output sequence. [27.7.1.2]/1 */ + _GLIBCXX_NODISCARD __string_type str() const _GLIBCXX_LVAL_REF_QUAL { @@ -262,6 +263,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #if _GLIBCXX_USE_CXX11_ABI #if __cpp_concepts template<__allocator_like _SAlloc> + _GLIBCXX_NODISCARD basic_string<_CharT, _Traits, _SAlloc> str(const _SAlloc& __sa) const { @@ -270,6 +272,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 } #endif + _GLIBCXX_NODISCARD __string_type str() && { @@ -696,6 +699,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } @@ -704,6 +708,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ + _GLIBCXX_NODISCARD __string_type str() const _GLIBCXX_LVAL_REF_QUAL { return _M_stringbuf.str(); } @@ -712,11 +717,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #if _GLIBCXX_USE_CXX11_ABI #if __cpp_concepts template<__allocator_like _SAlloc> + _GLIBCXX_NODISCARD basic_string<_CharT, _Traits, _SAlloc> str(const _SAlloc& __sa) const { return _M_stringbuf.str(__sa); } #endif + _GLIBCXX_NODISCARD __string_type str() && { return std::move(_M_stringbuf).str(); } @@ -920,6 +927,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } @@ -928,6 +936,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ + _GLIBCXX_NODISCARD __string_type str() const _GLIBCXX_LVAL_REF_QUAL { return _M_stringbuf.str(); } @@ -936,11 +945,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #if _GLIBCXX_USE_CXX11_ABI #if __cpp_concepts template<__allocator_like _SAlloc> + _GLIBCXX_NODISCARD basic_string<_CharT, _Traits, _SAlloc> str(const _SAlloc& __sa) const { return _M_stringbuf.str(__sa); } #endif + _GLIBCXX_NODISCARD __string_type str() && { return std::move(_M_stringbuf).str(); } @@ -1142,6 +1153,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * * This hides both signatures of std::basic_ios::rdbuf(). */ + _GLIBCXX_NODISCARD __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } @@ -1150,6 +1162,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ + _GLIBCXX_NODISCARD __string_type str() const _GLIBCXX_LVAL_REF_QUAL { return _M_stringbuf.str(); } @@ -1158,11 +1171,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #if _GLIBCXX_USE_CXX11_ABI #if __cpp_concepts template<__allocator_like _SAlloc> + _GLIBCXX_NODISCARD basic_string<_CharT, _Traits, _SAlloc> str(const _SAlloc& __sa) const { return _M_stringbuf.str(__sa); } #endif + _GLIBCXX_NODISCARD __string_type str() && { return std::move(_M_stringbuf).str(); } diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc index 08cbd5fc902..1ebadd1913f 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc @@ -60,7 +60,7 @@ void test01() { // process alphanumeric versions of bool values is_02.setf(std::ios_base::boolalpha); - is_02.flags(); + (void) is_02.flags(); is_02 >> b1; VERIFY( b1 == 1 ); is_02 >> b1; @@ -68,7 +68,7 @@ void test01() { // process numeric versions of of bool values is_02.unsetf(std::ios_base::boolalpha); - is_02.flags(); + (void) is_02.flags(); is_02 >> b1; VERIFY( b1 == 0 ); is_02 >> b1; diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc index 2b70390fe2b..26db8c549f2 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc @@ -58,7 +58,7 @@ void test01() { // process alphanumeric versions of bool values is_02.setf(std::ios_base::boolalpha); - is_02.flags(); + (void) is_02.flags(); is_02 >> b1; VERIFY( b1 == 1 ); is_02 >> b1; @@ -66,7 +66,7 @@ void test01() { // process numeric versions of of bool values is_02.unsetf(std::ios_base::boolalpha); - is_02.flags(); + (void) is_02.flags(); is_02 >> b1; VERIFY( b1 == 0 ); is_02 >> b1;