aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-08-16 17:56:40 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-08-16 17:56:40 +0100
commit450f33d6ba630730e86ebabb361651e00ac7741f (patch)
tree6f6471a3b412d5d2cc963398aa6d663eadd91047
parentbfbc18affacd44ba861f66dda222e2884c021874 (diff)
downloadgcc-450f33d6ba630730e86ebabb361651e00ac7741f.zip
gcc-450f33d6ba630730e86ebabb361651e00ac7741f.tar.gz
gcc-450f33d6ba630730e86ebabb361651e00ac7741f.tar.bz2
Avoid deprecation warning with -Wsystem-headers
C++17 says to use std::uncaught_exceptions() here instead of std::uncaught_exception() but since we only care whether the result is non-zero (and we aren't planning to remove the deprecated version) we can just keep using std::uncaught_exception() and suppress the warning. * include/std/ostream (basic_ostream::sentry::~sentry): Suppress deprecation warnings for using uncaught_exception(). From-SVN: r263593
-rw-r--r--libstdc++-v3/ChangeLog3
-rw-r--r--libstdc++-v3/include/std/ostream3
2 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6c277ff..fdf992e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,8 @@
2018-08-16 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/ostream (basic_ostream::sentry::~sentry): Suppress
+ deprecation warnings for using uncaught_exception().
+
PR libstdc++/86447
* src/c++11/cow-stdexcept.cc [_GLIBCXX_FULLY_DYNAMIC_STRING]
(logic_error::logic_error(logic_error&&))
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 448a928..2099294 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -444,6 +444,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit
sentry(basic_ostream<_CharT, _Traits>& __os);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/**
* @brief Possibly flushes the stream.
*
@@ -461,6 +463,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_os.setstate(ios_base::badbit);
}
}
+#pragma GCC diagnostic pop
/**
* @brief Quick status checking.