]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix test that fails for C++98 mode
authorJonathan Wakely <jwakely@redhat.com>
Fri, 26 Nov 2021 12:07:13 +0000 (12:07 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 26 Nov 2021 12:51:32 +0000 (12:51 +0000)
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.

libstdc++-v3/testsuite/27_io/types/1.cc

index a565c205b35cd4ee3ff98bfcba10579aeb60e771..b2838e429c9c0d14b39854d987be69d2a0fecf47 100644 (file)
 // 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 } }
 }