From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id E4DD5385742A; Mon, 9 May 2022 16:40:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4DD5385742A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r9-10065] libstdc++: Fix test that fails for C++98 mode X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: a1667b7a7bdf6070eb6294d0f3126b801201852c X-Git-Newrev: d6f5b5d9497b34161a2f5b473ad3346f5e2c89e8 Message-Id: <20220509164046.E4DD5385742A@sourceware.org> Date: Mon, 9 May 2022 16:40:46 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2022 16:40:47 -0000 https://gcc.gnu.org/g:d6f5b5d9497b34161a2f5b473ad3346f5e2c89e8 commit r9-10065-gd6f5b5d9497b34161a2f5b473ad3346f5e2c89e8 Author: Jonathan Wakely Date: Fri Nov 26 12:07:13 2021 +0000 libstdc++: Fix test that fails for C++98 mode When I backported r11-2760 as r10-8644 I simplified it and didn't add the new _GLIBCXX11_DEPRECATED macro. That means that the macro used on the old iostream members does nothing for C++98 mode, and so the test fails. This adjusts the test to only expect warnigns for C++11 and later. libstdc++-v3/ChangeLog: * testsuite/27_io/types/1.cc: Add c++11 target selector to warnings. (cherry picked from commit 4e1b821ca3b75ad8b2ebf5a50d41ff9ae71f73ba) Diff: --- libstdc++-v3/testsuite/27_io/types/1.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/types/1.cc b/libstdc++-v3/testsuite/27_io/types/1.cc index 19a42360b11..109cca55780 100644 --- a/libstdc++-v3/testsuite/27_io/types/1.cc +++ b/libstdc++-v3/testsuite/27_io/types/1.cc @@ -27,14 +27,14 @@ // Annex D, deprecated. void test01() { - typedef std::ios_base::streampos streampos_type; // { dg-warning "is deprecated: use 'std::streampos' instead" } - typedef std::ios_base::streamoff streamoff_type; // { dg-warning "is deprecated: use 'std::streamoff' instead" } + typedef std::ios_base::streampos streampos_type; // { dg-warning "is deprecated: use 'std::streampos' instead" "" { target c++11 } } + typedef std::ios_base::streamoff streamoff_type; // { dg-warning "is deprecated: use 'std::streamoff' instead" "" { target c++11 } } } // Annex D, deprecated. void test02() { - typedef std::ios_base::io_state iostate_type; // { dg-warning "is deprecated: use 'std::iostate' instead" } - typedef std::ios_base::open_mode openmode_type; // { dg-warning "is deprecated: use 'std::openmode' instead" } - typedef std::ios_base::seek_dir seekdir_type; // { dg-warning "is deprecated: use 'std::seekdir' instead" } + typedef std::ios_base::io_state iostate_type; // { dg-warning "is deprecated: use 'std::iostate' instead" "" { target c++11 } } + typedef std::ios_base::open_mode openmode_type; // { dg-warning "is deprecated: use 'std::openmode' instead" "" { target c++11 } } + typedef std::ios_base::seek_dir seekdir_type; // { dg-warning "is deprecated: use 'std::seekdir' instead" "" { target c++11 } } }