public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7213] libstdc++: Fix errors when syncbuf is used without RTTI
@ 2021-02-12 14:44 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-02-12 14:44 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:14b554c462d5b6450fa24afb7ba55435ebd4b46f

commit r11-7213-g14b554c462d5b6450fa24afb7ba55435ebd4b46f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 12 11:36:27 2021 +0000

    libstdc++: Fix errors when syncbuf is used without RTTI
    
    libstdc++-v3/ChangeLog:
    
            * include/std/ostream (__syncbuf_base::_S_get): Mark parameter
            as unused and only use dynamic_cast when RTTI is enabled.

Diff:
---
 libstdc++-v3/include/std/ostream | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 85ed47ecbce..c7c4e78e8a7 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -783,10 +783,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
     public:
       static bool*
-      _S_get(basic_streambuf<_CharT, _Traits>* __buf) noexcept
+      _S_get(basic_streambuf<_CharT, _Traits>* __buf [[maybe_unused]]) noexcept
       {
+#if __cpp_rtti
 	if (auto __p = dynamic_cast<__syncbuf_base*>(__buf))
 	  return &__p->_M_emit_on_sync;
+#endif
 	return nullptr;
       }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-12 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 14:44 [gcc r11-7213] libstdc++: Fix errors when syncbuf is used without RTTI Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).